Hi everybody!
I am just subscribed and I need some help with a Macro.
I am trying to have something similar to a VlookUp but I would like to have images instead of a value as a result.
Ex:
In Sheet 1
A1:A5 = Name of clothes (Sweater, Shirt, Jeans, Hat, Dress)
B1:B5 = Images JPG of Clothes according to the name in A column.
In Sheet 2
A1:A5 = Name of clothes in a different order
B1:B5 = I would like to have the images in Sheet 1 according to the name on A column
I found a macro on other website, and it works in the sense that I can write each cloth on Sheet 2 A1 and it gives me the correct image in B1, but in doesn't give me all the other images in the other rows.
The macro I used is the following:
Sub ImmAle()
'
FoglioTab = "Sheet1"
FoglioOut = "Sheet2"
CellaPos = "F1"
'
'
Look for the image...
RigaNum = Range("F1").Value
Sheets(FoglioTab).Activate
CurPos = Range("B" & RigaNum).Address
For Each Pict In ActiveSheet.Shapes
If Pict.TopLeftCell.Address = CurPos Then
NomeImm = Pict.Name: Exit For
End If
Next Pict
' …. and paste it on the Foglioout
Sheets(FoglioOut).Activate
If NomeImm = "" Then
MsgBox ("Nessuna Immagine corrisponde")
GoTo Uscita
End If
Sheets(FoglioTab).Shapes(NomeImm).Copy
Range("B2" & RigaNum).Select
ActiveSheet.Paste
Exit:
Application.EnableEvents = True
End Sub
In F1 I placed the following formula =MATCH(A1;Sheet1!A:A;0)
How could I do? What's wrong with this Macro ?
Thank you so much in advance!
Giulia
Bookmarks