MrExcel Publishing
Your One Stop for Excel Tips & Solutions

IsBlank in Macro


Posted by Brian S. on December 10, 2001 12:29 PM

Would like to use the Isblank function in macro however, excel tells me that the function is undefined. Is there a way to make it work? Is there something similar?

Thanks,
Brian S.


Posted by Bill Robbins on December 10, 2001 12:40 PM

Hi Brian.

This line of code might help:
If Application.WorksheetFunction.IsBlank(Range("L" & cell.Row & ":S" & cell.Row))
Then
... You can change the "if" to whatever you need and set the range to fit your requirements.

Hope this helps.

Regards,
Bill.

Posted by Tom Urtis on December 10, 2001 12:43 PM

There are a few ways to go about that depending on what you are trying to achieve.

If ActiveCell.Value = "" Then
Your code, etc
End If

Or

...SpecialCells(xlCellTypeBlanks) yada yada...

Could you please give an example of your macro so a relevant option can be suggested.

Tom Urtis

Posted by Brian S. on December 10, 2001 1:00 PM

Trying to see if cell G4 is blank in macro...might be looping through sheet so G4, H4, I4, etc. Haven't written macro yet!

Thanks,
Brian

Posted by Tom Urtis on December 10, 2001 1:09 PM

Hi Brian,

Sounds like you may be leaning towards conditional statements, perhaps as
If Sheets("Sheet1").Range("G4").Value = "" Then
[YOUR CODE]
End If

Any help?

Tom U

Posted by Brian S. on December 10, 2001 1:14 PM

Yes, that did it!! Thanks!
Brian