Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I was writing a macro to replace all the blank cells in a worksheet. The
problem faced is there are some cells which are blank, but when I check in the formula box, the value is some type of space(the way tab and whitespace character display a space. when you enter a character after them, then only you know that it has a space character before it.) €ŹWhen I tried displaying the character from a message box in my programme, the value displayed was as shown below. ? Can anyone help me to understand what is happening. It certainly is not a blank cell as when I try to check if its blank by using a statement like: val = worksheet("A").cells(2,1).value If val < "" then do this then it successfully enters the loop which is not the case for complete blank cells. please help me out. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
use trim function
like: If trim(val) < "" then do this "Monty" wrote: I was writing a macro to replace all the blank cells in a worksheet. The problem faced is there are some cells which are blank, but when I check in the formula box, the value is some type of space(the way tab and whitespace character display a space. when you enter a character after them, then only you know that it has a space character before it.) €ŹWhen I tried displaying the character from a message box in my programme, the value displayed was as shown below. ? Can anyone help me to understand what is happening. It certainly is not a blank cell as when I try to check if its blank by using a statement like: val = worksheet("A").cells(2,1).value If val < "" then do this then it successfully enters the loop which is not the case for complete blank cells. please help me out. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Have you tried something along the lines of "Empty" such as below Sub test() If ActiveCell.Value = Empty Then MsgBox "hello world" End If End Sub -- funkymonkUK ------------------------------------------------------------------------ funkymonkUK's Profile: http://www.excelforum.com/member.php...o&userid=18135 View this thread: http://www.excelforum.com/showthread...hreadid=574135 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
identifying blank cells by a colour | Excel Programming | |||
Identifying non-returning formula (blank Cell) | Excel Worksheet Functions | |||
identifying colours of existing elements / series | Charts and Charting in Excel | |||
Identifying first non blank cell in 3 different columns | Excel Discussion (Misc queries) | |||
Identifying blank rows | Excel Programming |