#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Do Until

I used "Do Until activecell = 0" in my prior Excel program but it doesn't
work in Excel 2002. Any suggestions? I would like a solution that solves
for blank rather than zero.

Thanks,

Roger


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Do Until

Hi Roger,

You could use the IsEmpty function to test for blanks, e.g.:

Sub Tester()
Dim rng As Range
Dim i As Long

Set rng = Range("A1:A10")

Do Until IsEmpty(rng(i + 1))
'Do something
i = i + 1
Loop
End Sub


---
Regards,
Norman



"Roger" wrote in message
...
I used "Do Until activecell = 0" in my prior Excel program but it doesn't
work in Excel 2002. Any suggestions? I would like a solution that solves
for blank rather than zero.

Thanks,

Roger



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Do Until

Hi Roger

It's an awful programming style, pardon my french, but it works in Excel
2002 also:

Sub test()
ActiveCell = 900
Do Until ActiveCell = 0
ActiveCell = ActiveCell - 1
Loop
End Sub

So your problem is elsewhere.

HTH. Best wishes Harald

"Roger" skrev i melding
...
I used "Do Until activecell = 0" in my prior Excel program but it doesn't
work in Excel 2002. Any suggestions? I would like a solution that solves
for blank rather than zero.

Thanks,

Roger




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Do Until


Hello Roger,

Change your code to this...


Code:
--------------------
Do While Not IsEmpty(ActiveCell)
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Do Until

Thanks so much to the 3 of you for your suggestions. I chose Leith's
because of its simplicity.

Roger

"Roger" wrote in message
...
I used "Do Until activecell = 0" in my prior Excel program but it doesn't
work in Excel 2002. Any suggestions? I would like a solution that solves
for blank rather than zero.

Thanks,

Roger



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



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