Karnage1210
New Member
- Joined
- Oct 17, 2018
- Messages
- 6
VB/Macro help! I am trying to create a way for a cell value which has a comment box in it as well to pull an image from a file destination based off the input in that cell. If someone types in a product ID into the cell the comment box will pull the image of the product on file.
So far I have been able to piece together something which allows me to run a macro for the specific active cell, set 1 specific image, but how do I enhance this to allow it to look for multiple images to drop into the comments based on the different cell values?
I'm too rusty with VB
So far I have been able to piece together something which allows me to run a macro for the specific active cell, set 1 specific image, but how do I enhance this to allow it to look for multiple images to drop into the comments based on the different cell values?
Code:
Sub Comments_Pic()
Dim PicComments As Comment
Dim LArea As Long
Dim PicturePath As String
Dim CellValue As Long
CellValue = ActiveCell.Value
'Explicitly Call Out The Image File Path
PicturePath = "R:\DestinationFolder\" & CellValue & ".jpg"
For Each PicComments In ActiveSheet.Comments
With PicComments
.Shape.Fill.UserPicture (PicturePath)
End With
Next
End Sub
I'm too rusty with VB