1st post here ... gentle on a vba newbie
I have a few pictures on a sheet
I'd like to return the AlternativeText from whatever picture the user clicks
(Then eventually, i'll find that Alt-Text on another sheet)
I found the property AlternativeText for Shape and ShapeRange ... but not sure how to get this for the clicked picture .... what i'm looking for:
Thanks In AdvanceSub subPicture_Click() ' varAltTxt = Selection.ShapeRange.AlternativeText ' varAltTxt = ActiveWindow.Selection.Shape.AlternativeText ' (^bombs out on both of these^) ' do other stuff with varAltTxt End Sub
Last edited by frittob; 03-13-2009 at 03:40 PM. Reason: Added code tags as per forum rules
This works for me.
If you still have problem post example file with picture.Dim shpTemp As Shape Set shpTemp = ActiveSheet.Shapes("Picture 1") MsgBox shpTemp.AlternativeText
Thanks Andy, I appreciate the response
How do i know which picture was clicked?
Your example uses "Picture 1" ... in the spreadsheet, i'll have multiple pictures, all running the same macro when the user clicks one
So how do you distinguish which picture was actually selected?
Assuming you have used the Assign Macro property on the pictures,
Set shpTemp = ActiveSheet.Shapes(Application.caller)
Perfect ... Thank You!
yup using the macro's ... The Alt-Text gives me kind of a poor mans menu system
User clicks on a picture, then i use the alt-text to do a find on a different sheet
Thanks again
Hello, i have a similar macro, but i research to do this with a function, rather than a click,
also i have a problem when there is multiple images in a cell, i would like to extract all the texts from this cell (with ; )
I join my workbook
Thnaks in advance for your help
Last edited by Nioubie; 11-21-2011 at 01:44 PM. Reason: Bad Thread (solved) should be a new one
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks