I hope someone can help me!
I am trying to display some pictures in excel by retreiving URL. I have many so called Macros expert do it but i still does't work.
everytime i execute the script it ends up empty.
here is the code, can someone pls help? is it because its a MAC version?
Sub IMAGE_V1()
Dim Rng As Range
Dim Cell As Range
Dim Pic As Picture
Rows("2:" & Range("A" & Rows.Count).End(xlUp).Row).RowHeight = 101.25
Columns("O").ColumnWidth = 36.57
Application.ScreenUpdating = False
Set Rng = Range("M2:M" & Range("A" & Rows.Count).End(xlUp).Row)
For Each Cell In Rng
With Cell
On Error Resume Next
Set Pic = .Parent.Pictures.Insert(.Value)
If Err <> 0 Then
Err.Clear
Else
With .Offset(, 2)
Pic.Top = .Top
Pic.Left = .Left
Pic.Height = .Height
Pic.Width = .Width
End With
End If
On Error GoTo 0
End With
Next Cell
'Application.ScreenUpdating = True
End Sub
Sub IMAGE_V2()
Dim Rng As Range
Dim Cell As Range
Dim Pic As Picture
'Rows("2:" & Range("AA" & Rows.Count).End(xlUp).Row).RowHeight = 101.25
'Columns("AC:AD").ColumnWidth = 36.57
'Application.ScreenUpdating = False
Set Rng = Range("N2:N" & Range("A" & Rows.Count).End(xlUp).Row)
For Each Cell In Rng
With Cell
On Error Resume Next
Set Pic = .Parent.Pictures.Insert(.Value)
If Err <> 0 Then
Err.Clear
Else
With .Offset(, 2)
Pic.Top = .Top
Pic.Left = .Left
Pic.Height = .Height
Pic.Width = .Width
End With
End If
On Error GoTo 0
End With
Next Cell
Application.ScreenUpdating = True
End Sub
I am trying to display some pictures in excel by retreiving URL. I have many so called Macros expert do it but i still does't work.
everytime i execute the script it ends up empty.
here is the code, can someone pls help? is it because its a MAC version?
Sub IMAGE_V1()
Dim Rng As Range
Dim Cell As Range
Dim Pic As Picture
Rows("2:" & Range("A" & Rows.Count).End(xlUp).Row).RowHeight = 101.25
Columns("O").ColumnWidth = 36.57
Application.ScreenUpdating = False
Set Rng = Range("M2:M" & Range("A" & Rows.Count).End(xlUp).Row)
For Each Cell In Rng
With Cell
On Error Resume Next
Set Pic = .Parent.Pictures.Insert(.Value)
If Err <> 0 Then
Err.Clear
Else
With .Offset(, 2)
Pic.Top = .Top
Pic.Left = .Left
Pic.Height = .Height
Pic.Width = .Width
End With
End If
On Error GoTo 0
End With
Next Cell
'Application.ScreenUpdating = True
End Sub
Sub IMAGE_V2()
Dim Rng As Range
Dim Cell As Range
Dim Pic As Picture
'Rows("2:" & Range("AA" & Rows.Count).End(xlUp).Row).RowHeight = 101.25
'Columns("AC:AD").ColumnWidth = 36.57
'Application.ScreenUpdating = False
Set Rng = Range("N2:N" & Range("A" & Rows.Count).End(xlUp).Row)
For Each Cell In Rng
With Cell
On Error Resume Next
Set Pic = .Parent.Pictures.Insert(.Value)
If Err <> 0 Then
Err.Clear
Else
With .Offset(, 2)
Pic.Top = .Top
Pic.Left = .Left
Pic.Height = .Height
Pic.Width = .Width
End With
End If
On Error GoTo 0
End With
Next Cell
Application.ScreenUpdating = True
End Sub