Hi-
I'm trying to write VBA to show images as comments for a list of item numbers.
1 - I have a file where the product images are saved that I'm referencing
2 - Some items are .png and some are .jpg - How do I write the code to look for either?
3 - If a product image is missing how do I make the code skip that product and look up the next one? (Right now the code stops when it hits a product that has no image)
4- I would like to set the size of the image as they're being distorted in the comment.
See below for how my code is written. Thank you in advance for your help. -KEEKS
Sub PictureToComments()
For Each cell In Range("a4:a100000")
cell.AddComment
cell.Comment.Text Text:=""
cell.Comment.Visible = True
cell.Comment.Shape.Select
Selection.ShapeRange.Fill.UserPicture "G:\North America Sales\Products\Necklaces\Images" & cell.Value & ".png"
cell.Select
cell.Comment.Visible = False
Next
End Sub