Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Using for next with two counters

Hi All,

Im trying to use a for next statement with two counters.
What i have so far:

DDRowCount and DateCount1 are variables defined earlier.
say DDRowCount = 4 and DateCount1 = 5
DataRange is a variable too, of the rows of data.

For n = 1 To DRRowCount
For d = 1 To DateCount1 + 5
DataRange.Cells(n, d).Value = "test"
Next d
Next n

This doesn't seem to be working.
Can i please ask for some help on this.

Cheers.
Alby

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Using for next with two counters

Albert,

Always use Option Explicit as the top of your modules.
Doing that would quickly point out that...

DDRowCount is not the same as DRRowCount
It works for me after making the correction.

Regards,
Jim Cone San Francisco, CA


"Albert Jameson" wrote in message
...
Hi All,
Im trying to use a for next statement with two counters.
What i have so far:
DDRowCount and DateCount1 are variables defined earlier.
say DDRowCount = 4 and DateCount1 = 5
DataRange is a variable too, of the rows of data.
For n = 1 To DRRowCount
For d = 1 To DateCount1 + 5
DataRange.Cells(n, d).Value = "test"
Next d
Next n
This doesn't seem to be working.
Can i please ask for some help on this.
Cheers.
Alby

Reply
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
Need help with Counters Vic Excel Discussion (Misc queries) 5 April 5th 10 06:38 PM
Date Counters Rachael Excel Worksheet Functions 0 March 6th 07 03:46 PM
Counters Paul Excel Worksheet Functions 2 February 11th 05 01:52 PM
Counters Terri[_5_] Excel Programming 2 September 27th 04 08:23 PM
counters tag Excel Programming 0 September 14th 03 12:48 AM


All times are GMT +1. The time now is 04:22 PM.

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"