Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,388
Default Stop Do While at Null

What is the function to end a Do While statemnet when encountering a null,
blank or empty cell?

Thank you
Dave


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Stop Do While at Null

Dave,

Try

If IsEmpty(ActiveCell) Then
Exit Do
End If


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



"Dave" wrote in message
...
What is the function to end a Do While statemnet when
encountering a null,
blank or empty cell?

Thank you
Dave




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Stop Do While at Null

Hi Dave,

Something like this...

Do Until rngYourCell.Value = ""
'loop activity here
Loop

--
Regards,
Zack Barresse, aka firefytr
To email, remove NOSPAM



"Dave" wrote in message
...
What is the function to end a Do While statemnet when encountering a null,
blank or empty cell?

Thank you
Dave




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Stop Do While at Null

i = 1
do while not isempty(cells(i,1))
cells(i,1).interior.colorIndex = 3
i = i + 1
Loop


i = 1
Do
cells(i,1).Interior.ColorIndex = 3
i = i + 1
Loop until isempty(cells(i,1)

--
Regards,
Tom Ogilvy

"Dave" wrote:

What is the function to end a Do While statemnet when encountering a null,
blank or empty cell?

Thank you
Dave


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,388
Default Stop Do While at Null

Should this do it? "Loop Until IsEmpty(ActiveCell.Cells)"


"Tom Ogilvy" wrote:

i = 1
do while not isempty(cells(i,1))
cells(i,1).interior.colorIndex = 3
i = i + 1
Loop


i = 1
Do
cells(i,1).Interior.ColorIndex = 3
i = i + 1
Loop until isempty(cells(i,1)

--
Regards,
Tom Ogilvy

"Dave" wrote:

What is the function to end a Do While statemnet when encountering a null,
blank or empty cell?

Thank you
Dave




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Stop Do While at Null

Take out the ".Cells" portion and it should work.

--
Regards,
Zack Barresse, aka firefytr
To email, remove NOSPAM



"Dave" wrote in message
...
Should this do it? "Loop Until IsEmpty(ActiveCell.Cells)"


"Tom Ogilvy" wrote:

i = 1
do while not isempty(cells(i,1))
cells(i,1).interior.colorIndex = 3
i = i + 1
Loop


i = 1
Do
cells(i,1).Interior.ColorIndex = 3
i = i + 1
Loop until isempty(cells(i,1)

--
Regards,
Tom Ogilvy

"Dave" wrote:

What is the function to end a Do While statemnet when encountering a
null,
blank or empty cell?

Thank you
Dave




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Stop Do While at Null

You can use that, but in this case it superfluous. Better to do as Zack
advises

as demonstrated from the immediate window:
? isempty(activecell.Cells)
True
? isempty(activecell)
True

Eventually you will mature in your coding want to stop selecting cells,
which slows your code way down and makes the screen flash. When you do, use
the methods I originally suggested.

--
Regards,
Tom Ogilvy


"Dave" wrote in message
...
Should this do it? "Loop Until IsEmpty(ActiveCell.Cells)"


"Tom Ogilvy" wrote:

i = 1
do while not isempty(cells(i,1))
cells(i,1).interior.colorIndex = 3
i = i + 1
Loop


i = 1
Do
cells(i,1).Interior.ColorIndex = 3
i = i + 1
Loop until isempty(cells(i,1)

--
Regards,
Tom Ogilvy

"Dave" wrote:

What is the function to end a Do While statemnet when encountering a

null,
blank or empty cell?

Thank you
Dave




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
Failed to save table attributes of (null) into (null). Luca Brasi Excel Discussion (Misc queries) 2 February 4th 09 04:30 PM
How do I stop chart from plotting null values as zeros in excel 20 suebee Charts and Charting in Excel 3 September 5th 08 06:33 PM
COUNTIF says Null = Blank but Blank < Null Epinn Excel Worksheet Functions 4 October 25th 06 08:03 PM
How do you stop excel from charting empty cells/null values as zer Abe-air Charts and Charting in Excel 3 March 20th 06 11:57 PM
cell value based on null/not null in another cell spence Excel Worksheet Functions 1 February 18th 06 11:49 PM


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