Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
SLP SLP is offline
external usenet poster
 
Posts: 58
Default loop till no more data

Hi,

How to I fix this so the loop stops when there is no more rows with data on
it? The number of rows will change each time the tool is used and I don't
want to have to guess every few days as to what number to use. Thanks much.

Sub MyLoop
For c = 1 to 1500
Call AllocateNew
Next c
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default loop till no more data

dim lr as long
lr=cells(rows.count,"a").end(xlup).row
for c=1 to lr

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"SLP" wrote in message
...
Hi,

How to I fix this so the loop stops when there is no more rows with data
on
it? The number of rows will change each time the tool is used and I don't
want to have to guess every few days as to what number to use. Thanks
much.

Sub MyLoop
For c = 1 to 1500
Call AllocateNew
Next c
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
SLP SLP is offline
external usenet poster
 
Posts: 58
Default loop till no more data

Thanks...I'll give that a try tomorrow. Enjoy the rest of your day!

"SLP" wrote:

Hi,

How to I fix this so the loop stops when there is no more rows with data on
it? The number of rows will change each time the tool is used and I don't
want to have to guess every few days as to what number to use. Thanks much.

Sub MyLoop
For c = 1 to 1500
Call AllocateNew
Next c
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
SLP SLP is offline
external usenet poster
 
Posts: 58
Default loop till no more data

Thanks. I'll try that tomorrow. Enjoy the rest of your day!

"Don Guillett" wrote:

dim lr as long
lr=cells(rows.count,"a").end(xlup).row
for c=1 to lr

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"SLP" wrote in message
...
Hi,

How to I fix this so the loop stops when there is no more rows with data
on
it? The number of rows will change each time the tool is used and I don't
want to have to guess every few days as to what number to use. Thanks
much.

Sub MyLoop
For c = 1 to 1500
Call AllocateNew
Next c
End Sub



.

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
hide formula in cells till data is available for calc kiwi Excel Discussion (Misc queries) 1 April 4th 10 12:52 AM
Loop till value changes Ruben Excel Discussion (Misc queries) 2 August 27th 08 09:07 AM
Loop Till the end of used Cell hon123456 Excel Programming 2 January 7th 08 07:32 AM
How can i Change Autofilter data from top till bottom in macro Vijay Kotian Excel Discussion (Misc queries) 0 September 5th 06 09:10 AM
macro to loop till end of page Nadiya Excel Programming 1 November 10th 04 05:18 PM


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