Hi there,
I have the following code but I need for it to keep going until the last cell that has data. I have no idea how to do this could anybody point me in the right direction?
(code)Private Sub Worksheet_Change(ByVal Target As Range)
Dim myPict As Picture
Dim PictureLoc As String
If Target.Address = Range("A2").Address Then
ActiveSheet.Pictures.Delete
PictureLoc = "C:\\Users\Admin\Desktop\images" & Range("A2").Value & ".png"
With Range("B2")
Set myPict = ActiveSheet.Pictures.Insert(PictureLoc)
.RowHeight = myPict.Height
myPict.Top = .Top
myPict.Left = .Left
myPict.Placement = xlMoveAndSize
End With
End If
End Sub (Code)
I have the following code but I need for it to keep going until the last cell that has data. I have no idea how to do this could anybody point me in the right direction?
(code)Private Sub Worksheet_Change(ByVal Target As Range)
Dim myPict As Picture
Dim PictureLoc As String
If Target.Address = Range("A2").Address Then
ActiveSheet.Pictures.Delete
PictureLoc = "C:\\Users\Admin\Desktop\images" & Range("A2").Value & ".png"
With Range("B2")
Set myPict = ActiveSheet.Pictures.Insert(PictureLoc)
.RowHeight = myPict.Height
myPict.Top = .Top
myPict.Left = .Left
myPict.Placement = xlMoveAndSize
End With
End If
End Sub (Code)