LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 76
Default Macro error - cant work it out...

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
On Error GoTo Doesn't Work [email protected] Excel Discussion (Misc queries) 2 November 29th 07 09:43 PM
DSUM gives a #VALUE! error and I can't work out why! Treasurer John Excel Worksheet Functions 2 August 14th 05 08:16 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM


All times are GMT +1. The time now is 02:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"