reflectingg0d
New Member
- Joined
- Mar 16, 2011
- Messages
- 3
Hello,
I need some help with a macro I'm working on. There are a few things I need it to do:
1) Retrieve the images from all hyperlinks in F1:F5000
2) Display each image in the same row column D at 50% scale
3) If an image is not available at the specified URL, or a URL is not present in column F, leave column D blank
Here is what I have been able to find so far. It pulls the image and puts it in column D, but only for one row.
Sub Macro4()
'
' Macro4 Macro
'
'
Dim URL As String
Dim sh As Object
URL = Worksheets("NOT IN BOOK").range("F2").Value
range("D2").Select
' ActiveSheet.Pictures.Insert(URL).Select
ActiveSheet.Select
range("D2").Select
sImageToLoad = URL
Set sh = ActiveSheet.Pictures.Insert(sImageToLoad)
sh.Select
Debug.Print TypeName(sh), TypeName(Selection)
Selection.ShapeRange.ScaleWidth 0.5, _
msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.5, _
msoFalse, msoScaleFromTopLeft
End Sub
To further complicate things, I am running 2010 at home but need it to run in 2003 for work.
Here is the link to the spreadsheet if it helps.
http://www.megaupload.com/?d=0JOFEA59
Thanks guys. I've learned a lot from this site so far, hopefully someone will be able to point me in the right direction.
Paul
I need some help with a macro I'm working on. There are a few things I need it to do:
1) Retrieve the images from all hyperlinks in F1:F5000
2) Display each image in the same row column D at 50% scale
3) If an image is not available at the specified URL, or a URL is not present in column F, leave column D blank
Here is what I have been able to find so far. It pulls the image and puts it in column D, but only for one row.
Sub Macro4()
'
' Macro4 Macro
'
'
Dim URL As String
Dim sh As Object
URL = Worksheets("NOT IN BOOK").range("F2").Value
range("D2").Select
' ActiveSheet.Pictures.Insert(URL).Select
ActiveSheet.Select
range("D2").Select
sImageToLoad = URL
Set sh = ActiveSheet.Pictures.Insert(sImageToLoad)
sh.Select
Debug.Print TypeName(sh), TypeName(Selection)
Selection.ShapeRange.ScaleWidth 0.5, _
msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.5, _
msoFalse, msoScaleFromTopLeft
End Sub
To further complicate things, I am running 2010 at home but need it to run in 2003 for work.
Here is the link to the spreadsheet if it helps.
http://www.megaupload.com/?d=0JOFEA59
Thanks guys. I've learned a lot from this site so far, hopefully someone will be able to point me in the right direction.
Paul