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


I'm wondering if the IsEmpty() checks the entire range that i'v
specified.? I am trying to generate a check for empty ranges wher
there should be data...here's what i have so far...
(checks every 11th row after the first one)

For J = 12 To 608
Set rng = Range("D" & J, "O" & J)
If IsEmpty(rng) = True Then
MsgBox "no values entered for analyte on line " & J
Exit Sub
Else
J = J + 10
End If
Next J

I just cannot get this to work, any suggestions?
thanks

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default isempty

Use something like this chick-racer

If Application.WorksheetFunction.CountA(rng) = 0 Then MsgBox "empty"

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"chick-racer" wrote in message ...

I'm wondering if the IsEmpty() checks the entire range that i've
specified.? I am trying to generate a check for empty ranges where
there should be data...here's what i have so far...
(checks every 11th row after the first one)

For J = 12 To 608
Set rng = Range("D" & J, "O" & J)
If IsEmpty(rng) = True Then
MsgBox "no values entered for analyte on line " & J
Exit Sub
Else
J = J + 10
End If
Next J

I just cannot get this to work, any suggestions?
thanks!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default isempty

Ron has provided you with a solution.

To clarify, the confusingly-named IsEmpty has to do with whether or not a
variable has been initialized, and not with whether or not a range is empty.

--

Vasant

"chick-racer" wrote in message
...

I'm wondering if the IsEmpty() checks the entire range that i've
specified.? I am trying to generate a check for empty ranges where
there should be data...here's what i have so far...
(checks every 11th row after the first one)

For J = 12 To 608
Set rng = Range("D" & J, "O" & J)
If IsEmpty(rng) = True Then
MsgBox "no values entered for analyte on line " & J
Exit Sub
Else
J = J + 10
End If
Next J

I just cannot get this to work, any suggestions?
thanks!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default isempty

Vasant,

Although Help says it works on variables, it also works on a single cell
range. For instance

?IsEmpty(Range("A1"))

returns True if A1 has no data, False if it does.

?IsEmpty(Range("A1:D1")

returns False whatever the contents.

I guess VBA converts the Range value into a temporary variable.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
Ron has provided you with a solution.

To clarify, the confusingly-named IsEmpty has to do with whether or not a
variable has been initialized, and not with whether or not a range is

empty.

--

Vasant

"chick-racer" wrote in message
...

I'm wondering if the IsEmpty() checks the entire range that i've
specified.? I am trying to generate a check for empty ranges where
there should be data...here's what i have so far...
(checks every 11th row after the first one)

For J = 12 To 608
Set rng = Range("D" & J, "O" & J)
If IsEmpty(rng) = True Then
MsgBox "no values entered for analyte on line " & J
Exit Sub
Else
J = J + 10
End If
Next J

I just cannot get this to work, any suggestions?
thanks!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/





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
Loop Statement through If Not IsEmpty Then Paste into Destination Dandelo Excel Discussion (Misc queries) 7 July 15th 08 10:29 PM
Form If IsEmpty Syntax Gizmo Excel Discussion (Misc queries) 4 May 25th 08 03:50 PM
Problem with IsEmpty Function Matt[_16_] Excel Programming 6 October 2nd 03 05:16 PM
IsEmpty and Is Nothinq problems Stuart[_5_] Excel Programming 12 August 29th 03 06:13 AM


All times are GMT +1. The time now is 01:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"