Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Generic n in For n To xxxxx


Using For n = 1 To xxxxx step 1 or for n = xxxxx To 1 Step -1 is it
possible to state the high number in some generic foremat so that the
high number does not have to be precisely stated for each new data list
and you can be sure that the procedure has executed through the entire
data list?


--
knowtrump
------------------------------------------------------------------------
knowtrump's Profile: http://www.excelforum.com/member.php...o&userid=19664
View this thread: http://www.excelforum.com/showthread...hreadid=510873

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Generic n in For n To xxxxx

I'm not sure what you're asking, but I'll take a guess. If you
are looping through row numbers, you can get the last used row in
column "A" with code like

xxxxx = Cells(Rows.Count,"A").End(xlUp).Row

You might want to provide a few more details.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"knowtrump"
wrote in
message
...

Using For n = 1 To xxxxx step 1 or for n = xxxxx To 1 Step -1
is it
possible to state the high number in some generic foremat so
that the
high number does not have to be precisely stated for each new
data list
and you can be sure that the procedure has executed through the
entire
data list?


--
knowtrump
------------------------------------------------------------------------
knowtrump's Profile:
http://www.excelforum.com/member.php...o&userid=19664
View this thread:
http://www.excelforum.com/showthread...hreadid=510873



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Generic n in For n To xxxxx

knowtrump,
I guess you asking:
Dim StartCounter As Long
Dim StopCounter As Long
Dim Stepper As Long
StartCounter =MyRange1.Value
StopCounter =MyRange2.Value 'Or from Karl:
=Cells(Rows.Count,"A").End(xlUp).Row
Stepper=MyRange3.Value
For i=StartCounter to StopCounter Step Stepper
......

NickHK

"knowtrump" wrote
in message ...

Using For n = 1 To xxxxx step 1 or for n = xxxxx To 1 Step -1 is it
possible to state the high number in some generic foremat so that the
high number does not have to be precisely stated for each new data list
and you can be sure that the procedure has executed through the entire
data list?


--
knowtrump
------------------------------------------------------------------------
knowtrump's Profile:

http://www.excelforum.com/member.php...o&userid=19664
View this thread: http://www.excelforum.com/showthread...hreadid=510873



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Generic n in For n To xxxxx


Thanks Chip and Nick. Sorry that my query lacked in detail. However
your answers are what I was looking for. While conventional wisdo
says there are no "dumb" questions I guess it is certainly possible t
be less than smart about how you phrase them. My bad. Thanks again

--
knowtrum
-----------------------------------------------------------------------
knowtrump's Profile: http://www.excelforum.com/member.php...fo&userid=1966
View this thread: http://www.excelforum.com/showthread.php?threadid=51087

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Generic n in For n To xxxxx


Thanks Chip and Nick. Sorry that my query lacked in detail. However,
your answers are what I was looking for. While conventional wisdom
says there are no "dumb" questions I guess it is certainly possible to
be less than smart about how you phrase them. My bad. Thanks again.


--
knowtrump
------------------------------------------------------------------------
knowtrump's Profile: http://www.excelforum.com/member.php...o&userid=19664
View this thread: http://www.excelforum.com/showthread...hreadid=510873

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
Generic Macro WildWill Excel Discussion (Misc queries) 7 February 2nd 10 02:21 PM
Define a generic name Nelson Excel Worksheet Functions 3 July 17th 09 10:01 PM
If statement with generic value Blessedx3 Excel Worksheet Functions 5 December 19th 08 07:21 PM
Make name Generic Duncan J Excel Programming 2 February 17th 04 05:21 PM
Generic Macro Steve Excel Programming 3 January 22nd 04 09:03 PM


All times are GMT +1. The time now is 10:10 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"