LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Error after last object in the array when looping For...each

Hi,
I have named chartobjects grouped as an array "arGrp21" and when I run the
"For each chtobj..." the loop works ok until the last, "R_Q_F_21", is done.
After "R_Q_F_21" I get error with the line "Next" . Does I have to tell how
many chartobjects there is? How? Else: What is the error with my code?

/Regards

Code Simplified:

Sub ArrayList
Dim arGrp21() As Variant

arGrp21 = Array("R_CF_FB_21", "R_ROI_FB_21", "R_Q_FB_21", "R_CF_FBA_21",
"R_ROI_FBA_21", "R_Q_FBA_21", "R_CF_F_21", "R_ROI_F_21", "R_Q_F_21")

Call RestoreFontsEtc(arGrp21)
End sub


Sub RestoreFontsEtc(arCht As Variant)
Dim chtobj As ChartObject
For Each chtobj In Sheet1.ChartObjects(arCht)
chtobj.Height = 300
chtobj.Width = 450
Next
End Sub


 
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
How to write an array to a range without looping Andy Excel Worksheet Functions 3 April 27th 11 12:52 PM
Looping through Sheets and passing values to an Array Michael Rhein Excel Programming 2 February 13th 04 10:54 AM
Range object to Array object conversion Myrna Larson[_2_] Excel Programming 1 August 1st 03 02:27 AM
Range object to Array object conversion Alan Beban[_3_] Excel Programming 0 August 1st 03 01:24 AM
Range object to Array object conversion Tom Ogilvy Excel Programming 0 August 1st 03 12:16 AM


All times are GMT +1. The time now is 03:33 AM.

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

About Us

"It's about Microsoft Excel"