excelhelp19
New Member
- Joined
- Oct 11, 2017
- Messages
- 7
Hello, I am using the following code to insert a list of pics, it inserts a link to the pics instead of pasting the pics, can someone help
Sub InsertPictures()
'Application.ScreenUpdating = False
'ThisWorkbook.Worksheets("CONTENTS").Visible = xlVisible
Dim CONT As Worksheet
Set CONT = ThisWorkbook.Worksheets("CONTENTS")
Dim RNG As Range
Dim MYCELL As Range
Dim WS As String
Dim T As Worksheet
Dim P As String
Set RNG = CONT.Range("A4:A500")
For Each MYCELL In RNG
If MYCELL <> "" Then
WS = MYCELL
P = MYCELL.Offset(0, 3)
Worksheets(WS).Select
Worksheets(WS).Range("A16").Select
ActiveSheet.Pictures.Insert(ThisWorkbook.PATH & "\PHOTO" & P).Select
With Selection
.Left = Range("A16").Left
.Top = Range("A16").Top
.ShapeRange.Width = 1030#
.ShapeRange.Rotation = 0#
End With
End If
Next
End Sub
Sub InsertPictures()
'Application.ScreenUpdating = False
'ThisWorkbook.Worksheets("CONTENTS").Visible = xlVisible
Dim CONT As Worksheet
Set CONT = ThisWorkbook.Worksheets("CONTENTS")
Dim RNG As Range
Dim MYCELL As Range
Dim WS As String
Dim T As Worksheet
Dim P As String
Set RNG = CONT.Range("A4:A500")
For Each MYCELL In RNG
If MYCELL <> "" Then
WS = MYCELL
P = MYCELL.Offset(0, 3)
Worksheets(WS).Select
Worksheets(WS).Range("A16").Select
ActiveSheet.Pictures.Insert(ThisWorkbook.PATH & "\PHOTO" & P).Select
With Selection
.Left = Range("A16").Left
.Top = Range("A16").Top
.ShapeRange.Width = 1030#
.ShapeRange.Rotation = 0#
End With
End If
Next
End Sub