LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default IsBlank() in VBA code?

I had the need to use the ISBLANK() worksheet function in some VBA code, so
I went into the editor, typed "WorksheetFunction.Is" and the first thing
that came up in the Intellisense list was IsError. ??? So I scrolled up and
found I had passed items starting with "is," meaing IsError was defintely
the first in the list. I take it this means all worksheet functions are not
necessarily available in VBA macros?

And for reference, in case this was some weird thing that didn't show in
Intellisense but still worked in code (like the Print method of the Printer
object in VB6) I manually typed "IsBlank" and tried to run the macro. I got
an error saying the WorksheetFunction object didn't support this method.

Ultimately, the problem I was trying to solve was one of "Excel being
Excel." I have a spreadsheet that has lots of blank cells (they don't even
contain spaces) which Excel doesn't THINK are blank cells. That is, when I
use the COUNTA() function on a range with these cells, they are counted and
not ignored. (If I simply go into edit mode in the cell and then hit Enter,
Excel wakes up and realizes the cell really is blank.) So what? Well, I have
some macros that do what they do until they encounter a blank cell. I test
for "blankness" by checking the Value of the cell against the empty string.
The problem is that these cells return the empty string for their value but
they're not really blank in Excel's eyes, so I'm looking for a better way to
detect them. If ISBLANK() were available in code then I could check that
instead.


 
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
IF and ISBLANK projectnewbie Excel Worksheet Functions 4 July 30th 08 05:41 PM
ISBLANK() kw_uh97 Excel Worksheet Functions 8 June 30th 07 06:42 AM
ISBLANK Gimpy815 Excel Worksheet Functions 2 February 24th 06 06:09 PM
IF(ISBLANK) Bill R Excel Worksheet Functions 4 August 13th 05 07:43 PM
Isblank Code Greg B... Excel Programming 2 February 28th 05 09:47 AM


All times are GMT +1. The time now is 01:37 PM.

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"