Excel VBA - Use Application.Caller to get cell coords for an image -
i trying create script has "delete tool" button. tool take 5 rows. so, code delete 5 rows when x button hit, , delete x button because no longer necessary.
the issue having how find cell address of picture clicked? below code have begun use.
sub deleterow() dim check integer dim r range dim m picture dim strcallertyp string strcallertyp = typename(application.caller) select case strcallertyp case "string" check = msgbox("are sure want remove tool?", vbyesnocancel, "delete tool") if (check = 6) msgbox sheets("sheet1").shapes(application.caller).topleftcell '*this line*' end if case "error" msgbox "error" end select end sub why line (marked in code):
msgbox sheets("sheet1").shapes(application.caller).topleftcell
opening message box says "excel" instead of coordinate?
tia!
add .address end of line
msgbox sheets("sheet1").shapes(application.caller).topleftcell.address
hth, ojf
Comments
Post a Comment