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: 46
Default Testing for text using VBA

I have been experimenting trying to find a way to use VBA to test to
see if a user has entered text into a cell.

I have tried Len and istext without success - perhaps I am not doing
it correctly, I am not sure. However through trial and error I found
something that seems to work - I just want to be sure that it is not a
fluke (no insult to the Fluke Mfg. company intended).

I am trying in this example to determine if there is text in cell
E14. I found that if I compare the value cell E14 to a positive
integer (and then place a numerical value in cell G14 just as a test),
it seems to work as follows;

If Range("E14").Value < 1 Then Range("G14").Value = 7

I find that if cell E14 has text in it, then the formula runs and G7
remains blank. If there is text in E14, then the formula result is
that G7 returns the value of 7. I have tried this with several
entries, and it seems to work. The cell E14 is set to 'General' by
the way.

I do not understand why it works. Is this going to work all of the
time, or is it just a fluke? I would appreciate knowing if I am
creating a problem for myself in the future if I use this test in a
VBA program. Can someone tell me if what I am doing is going to be
reliable and work in the future?

Thanks in advance, again...
 
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
User form - Testing for numbers or text NDBC Excel Discussion (Misc queries) 5 July 1st 09 06:59 AM
Opening and Testing Large Text File Ken Hudson Excel Programming 2 May 13th 05 03:33 PM
Testing text on a shape Ajtb Excel Programming 2 February 15th 05 12:42 PM
Testing for text Edgar Thoemmes[_4_] Excel Programming 1 October 26th 04 12:58 PM
Testing for text Art Excel Programming 2 March 2nd 04 02:12 PM


All times are GMT +1. The time now is 09:40 AM.

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"