Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Loop never ends

I guess you were using the "Do While...Loop". There are 2 ways to tackle this problem. First, you could use a finite loop "For i = 1 to n... Next i" but you would then have to find out how many rows you have for looping; Second, you could use "Do While... Loop" with with "ISEMPTY()" here's how I would do it:

i=0
Do while isempty([A1].offset(i,0))=false

'Programming codes.....

i=i+1
Loop

This will go through each cell in column A until it reaches the first empty cell. Obviously, in this case, I would have to assume that all cells in Column A is not blank.

"useless at looping!" wrote:

I have a macro that I run every month which calculates commission and one of columns in my spreadsheets uses vlookup. I would like the macro to paste the vlookup command I am using into cells in column AD only if the cell in column AC is not blank. I have tried creating loops but they either stop after pasting into the first cell or continue on forever.

Anyone who can help? It would be greatly appreciated!!!

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
vertical scale on both ends of bar chart Midjack Charts and Charting in Excel 1 April 6th 09 01:44 AM
long number ends in 000 justanotherdayatwork Excel Discussion (Misc queries) 2 December 22nd 08 09:29 AM
round up (ends with...) jatman Excel Worksheet Functions 3 August 30th 08 12:59 PM
filter using "ends with" and 3 choices? Ex: ends with 1,2 or3 Debbie Excel Worksheet Functions 1 April 6th 07 12:07 AM
Loop ends early BrianB Excel Programming 0 August 15th 03 12:13 PM


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