Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
vertical scale on both ends of bar chart | Charts and Charting in Excel | |||
long number ends in 000 | Excel Discussion (Misc queries) | |||
round up (ends with...) | Excel Worksheet Functions | |||
filter using "ends with" and 3 choices? Ex: ends with 1,2 or3 | Excel Worksheet Functions | |||
Loop ends early | Excel Programming |