Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Robert Crandal wrote:
"Auric__" wrote in message .116... Built in? Not that I know of, but you could try this: Function isWhitespace(ByVal what As String) As Boolean what = Replace(what, " ", "") what = Replace(what, vbTab, "") what = Replace(what, vbCr, "") what = Replace(what, vbLf, "") isWhitespace = CBool(Len(what)) End Function Hi Auric..... I tried the above function but it seems to return TRUE for cases that should be false. I ran it on the below data file: item1 scissors item2 glue Each line is read into a string variable. I then passed each string variable into "isWhitespace()" one at a time and it returned TRUE each time. Am I doing something wrong here? (This is what happens when I post while tired...) No, Ron Rosenfeld is correct, I got the truth values reversed. The last line should be: isWhitespace = Not(CBool(Len(what))) ....or you can use one of the solutions Ron or RB Smissaert posted. -- He doesn't know when to give up, this guy. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Test for string of space chars? | Excel Programming | |||
Test for NULL string? | Excel Programming | |||
extract cusotmer name from test string | Excel Worksheet Functions | |||
logical test and concatenate(string) | Excel Discussion (Misc queries) | |||
Test String | Excel Discussion (Misc queries) |