#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Cell vales

I am trying in a macro to check if a cell in a work sheet is NOT blank.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Cell vales

Test its Value property for not being the empty cell...

If Range("A1").Value < "" Then

or, alternately, test the length of the Value for being larger than zero...

If Len(Range("A1").Value) 0 Then

--
Rick (MVP - Excel)


"Mike" wrote in message
...
I am trying in a macro to check if a cell in a work sheet is NOT blank.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Cell vales

If you want to look for an empty cell -- no formula that evaluates to "".

if isempty(worksheets("Somesheetnamehere").range("A1" ).value) then
'it's empty
else
'it's got something in it.
end if

checking for "" with something like this may not be enough:

if worksheets("Somesheetnamehere").range("A1").value = "" then
'cell looks empty, but it may have a formula that evaluates to ""
'it may even be empty
else
'cell has something in it for sure
end if



Mike wrote:

I am trying in a macro to check if a cell in a work sheet is NOT blank.


--

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
Return multiple vales from a different spreadsheet into one cell Rodders Excel Discussion (Misc queries) 10 August 6th 08 06:41 AM
Equation Editor and substituting vales Steve Excel Programming 0 July 12th 08 08:46 PM
Counting Unique Vales in a column frankjh19701 Excel Worksheet Functions 4 May 10th 07 03:16 AM
extract matching vales TUNGANA KURMA RAJU Excel Discussion (Misc queries) 15 October 25th 06 06:53 PM
Need an OR Function that will allow for Text vales......... nevi Excel Worksheet Functions 3 April 6th 06 07:15 PM


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