N
NPell
Dim icon As Variant
Dim myicon As Variant
myicon = Array("icona1", "icona2", "icona3", "icona4", "icona5",
"icona6", "icona7", "icona8", "icona9", "icona10", "icona11",
"icona12")
myref = Array("d3", "d4", "D5", "D6", "D7", "D8", "D9", "D10", "D11",
"D12", "D13", "D14")
I = LBound(myref)
For Each icon In myicon
Set myicon.Picture = LoadPicture("filepath" & Sheets("Sheet1").Range
(myref(I)).Value & ".bmp")
I = I + 1
Next icon
---------------------------------
This works as
Set icona1.Picture = LoadPicture("filepath" & Sheets("Sheet1").Range
("D3").Value & ".bmp")
Set icona2.Picture = LoadPicture("filepath" & Sheets("Sheet1").Range
("D4").Value & ".bmp")
etc..
So why not with the For statement...
Any suggestions?
Cheers
Dim myicon As Variant
myicon = Array("icona1", "icona2", "icona3", "icona4", "icona5",
"icona6", "icona7", "icona8", "icona9", "icona10", "icona11",
"icona12")
myref = Array("d3", "d4", "D5", "D6", "D7", "D8", "D9", "D10", "D11",
"D12", "D13", "D14")
I = LBound(myref)
For Each icon In myicon
Set myicon.Picture = LoadPicture("filepath" & Sheets("Sheet1").Range
(myref(I)).Value & ".bmp")
I = I + 1
Next icon
---------------------------------
This works as
Set icona1.Picture = LoadPicture("filepath" & Sheets("Sheet1").Range
("D3").Value & ".bmp")
Set icona2.Picture = LoadPicture("filepath" & Sheets("Sheet1").Range
("D4").Value & ".bmp")
etc..
So why not with the For statement...
Any suggestions?
Cheers