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: 26
Default Iterating through a collection (For Each)

Hello guys,

The following issue is at my hands:
Dim hCollection as New Collection
'declaration of the collection variables and assigning values to the
variables...

For Each hCollection.Item In hCollection
'If sDate = hCollection.Item(1) Or sDate = hCollection.Item(2) Or sDate =
'hCollection.Item(3) Or sDate = hCollection.Item(4) Or sDate =
hCollection.Item(5)
'Or sDate = hCollection.Item(6) Or sDate = hCollection.Item(7) Or sDate =
'hCollection.Item(8) Or sDate = hCollection.Item(9) 'Or sDate =
hCollection.Item(10) Then
Toef = (uitVM - inVM) + (uitNM - inNM) + NaR + CAD
Else
Toef = ""
End If

I am trying a different approach for the items that here are commented out
(and which works great). I'm trying a For Each here in the first line, but
the line "For Each hCollection.Item In hCollection" causes a "Argument not
Optional" error...

Thanks in advance guys
 
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
iterating groups? Mike[_98_] Excel Programming 1 September 21st 05 11:11 AM
iterating checkboxes [email protected] Excel Discussion (Misc queries) 1 May 11th 05 08:42 PM
Iterating Thru Cells Kelvin Clayson Excel Programming 6 November 9th 04 06:33 PM
Iterating through cells problem heenchi Excel Programming 1 June 9th 04 06:25 PM
iterating through all properties of an object Barney Fife Excel Programming 4 August 22nd 03 03:18 AM


All times are GMT +1. The time now is 10:22 AM.

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"