Showing posts with label Print the Shape Name and Text You Clicked. Show all posts
Showing posts with label Print the Shape Name and Text You Clicked. Show all posts

Monday, August 22, 2011

Print the Shape Name and Text You Clicked

If you want to know the shape name and shape inside text which you have clicked to Run a Macro. Snapshot Below-



Here is the code

Sub test()
' it will display you the shape name which you have clicked
MsgBox "Shape Name ---------> " & Application.Caller
' it will display you the text inside the shape which you have clicked
MsgBox "Shape Inside Text ---------> " & ActiveSheet.Shapes(Application.Caller).TextFrame.Characters.Text

End Sub

assign this macro to each shape.


Excel Macro File http://www.filefactory.com/file/cd26f4b/n/Design.xlsm

Import data from SQL

Macro to import data from SQL using ADO connection string: Sub Import_data_from_SQL() ' Tools -> References -> Microsoft Active...