Hello Excel Gurus,
To start off I am learning macro as I go. But here goes to what I am trying to do for this macro. I have a tab lets say "Sheet1" where there is two columns of data A:B. Column B has hyperlinks to PDF's. Then I have "Sheet2" where I have cell B2 where someone can enter in a value. That value is then vlookup in column A in Sheet1 and the corresponding hyperlink is put into Sheet2 cell B2. What I am then trying to do is take the URL and open it and copy the image on the PDF and pasting it back in cell A4 on Sheet2.
I tried this code, however it does not work, please provide any guidance:
Sub Test()
Dim pic As String
Dim myPicture As Picture
On Error Resume Next
pic = Worksheets("Drawing").Range("C2")
Set myPicture = ActiveSheet.Pictures.Insert(pic)
With myPicture
.ShapeRange.LockAspectRatio = msoFalse
.Width = cl.Width
.Height = cl.Height
.Top = Rows(cl.Row).Top
.Left = Columns(cl.Column).Left
End With
End Sub
To start off I am learning macro as I go. But here goes to what I am trying to do for this macro. I have a tab lets say "Sheet1" where there is two columns of data A:B. Column B has hyperlinks to PDF's. Then I have "Sheet2" where I have cell B2 where someone can enter in a value. That value is then vlookup in column A in Sheet1 and the corresponding hyperlink is put into Sheet2 cell B2. What I am then trying to do is take the URL and open it and copy the image on the PDF and pasting it back in cell A4 on Sheet2.
I tried this code, however it does not work, please provide any guidance:
Sub Test()
Dim pic As String
Dim myPicture As Picture
On Error Resume Next
pic = Worksheets("Drawing").Range("C2")
Set myPicture = ActiveSheet.Pictures.Insert(pic)
With myPicture
.ShapeRange.LockAspectRatio = msoFalse
.Width = cl.Width
.Height = cl.Height
.Top = Rows(cl.Row).Top
.Left = Columns(cl.Column).Left
End With
End Sub