Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Can you do IsEmpty(Range)?

As I progress in VBA, I'm trying to make my macros more elegant and
less heavy-handed. One of those problems is how I end Do loops with
embedded If loops. I was previously just inserting a stop point in the
column. Something like 'Do Until ActiveCell = "End"'.
That works ok, until the range I'm working on is much shorter than my
stop range.

Is it possible to use IsEmpty to test a 15 cell block, and if they're
all empty to end, or insert my end point?

I've tried using the following code, but it doesn't work.

Range("C1").Select
Do Until ActiveCell = "ZZZ"
Range(ActiveCell, ActiveCell.Offset(15, 0)).Select
If IsEmpty(Selection) = True Then
ActiveCell.Offset(10, 0).Select
ActiveCell.FormulaR1C1 = "ZZZ"
Else: ActiveCell.Offset(5, 0).Select
End If
Loop

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Can you do IsEmpty(Range)?

You have a response at your other post.

Sharkbait wrote:

As I progress in VBA, I'm trying to make my macros more elegant and
less heavy-handed. One of those problems is how I end Do loops with
embedded If loops. I was previously just inserting a stop point in the
column. Something like 'Do Until ActiveCell = "End"'.
That works ok, until the range I'm working on is much shorter than my
stop range.

Is it possible to use IsEmpty to test a 15 cell block, and if they're
all empty to end, or insert my end point?

I've tried using the following code, but it doesn't work.

Range("C1").Select
Do Until ActiveCell = "ZZZ"
Range(ActiveCell, ActiveCell.Offset(15, 0)).Select
If IsEmpty(Selection) = True Then
ActiveCell.Offset(10, 0).Select
ActiveCell.FormulaR1C1 = "ZZZ"
Else: ActiveCell.Offset(5, 0).Select
End If
Loop

Thanks


--

Dave Peterson
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
Either an "IsEmpty" or a Range issue.... Celt[_48_] Excel Programming 1 April 7th 06 12:10 AM
IsEmpty on a range/array Norman Jones Excel Programming 3 September 7th 04 08:35 PM
IsEmpty on a range/array JE McGimpsey Excel Programming 0 September 7th 04 07:25 PM
Help with IsEmpty Fred Excel Programming 1 February 10th 04 03:12 PM
vba: isempty chick-racer[_37_] Excel Programming 3 November 17th 03 09:52 PM


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