Insert hyperlink into pic using vba
-
i have a new list of model pics Col A has the model number and Col B the pic. i already used code to pick up the Model from Col A to name the pic. now the new list does not contain some of the old models which have been discontinued. i want to pick up the hyperlink address from the old pics. here is what i have: Dim myLink As String For Each c In Range("A9:A243") 'The new list mymodel = c.Value Set y = Sheets("Pic List").Range("A:A").Find(mymodel, LookAt:=xlWhole) 'The old list If y Is Nothing Then c.Interior.Color = 255 ' New model so no hyperlink in old list so do manually Else 'Using the Watch window I get a value for myLink myLink = Sheets("Pic List").Shapes(mymodel).Hyperlink.Address 'Gets hyperlink from old list 'The next line gives me an 'Application or Object defined error' ActiveSheet.Shapes(mymodel).Hyperlink.Address = myLink End If Next c End Sub thanks for the help
-
Answer:
The code ActiveSheet.Shapes(mymodel).Hyperlink.Address = myLink is wrong. To give the shape mymodel on Sheet1 a hyperlink to the address myLink, use code like this Dim myLink As String Dim shp As Shape [...] Set wks = ThisWorkbook.Sheets("Sheet1") Set shp = wks.Shapes(mymodel) shp.Hyperlink.Delete wks.Hyperlinks.Add shp, myLink
Miningco.com Visit the source
Related Q & A:
- How to insert data in db using jsp?Best solution by Yahoo! Answers
- How I can find string in excel with vba?Best solution by Stack Overflow
- What is hyperlink? How to hyperlink?Best solution by Yahoo! Answers
- How do I put a pic beside a pic on my Myspace?Best solution by Yahoo! Answers
- What is a 360 pic on yahoo and how do I put pic of me on there?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.