#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Text Sub

I need help creating a sub that checks "A1" to see if it has text in the
cell, and if so run routine A Else routine B.

Any help is always appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Text Sub

Sub Main
if Worksheets("Sheet1").Range("A1").Value < "" then
routineA
else
routineB
end if
End Sub

this runs routineA if A1 is not empty. If you want to check for a specific
value replace with

if Worksheets("Sheet1").Range("A1").Value = "ABCD" then


--
Regards,
Tom Ogilvy


"Ronbo" wrote in message
...
I need help creating a sub that checks "A1" to see if it has text in the
cell, and if so run routine A Else routine B.

Any help is always appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Text Sub

Tom, as always... thanks alot for your help.

Regards,
Ronbo

"Tom Ogilvy" wrote:

Sub Main
if Worksheets("Sheet1").Range("A1").Value < "" then
routineA
else
routineB
end if
End Sub

this runs routineA if A1 is not empty. If you want to check for a specific
value replace with

if Worksheets("Sheet1").Range("A1").Value = "ABCD" then


--
Regards,
Tom Ogilvy


"Ronbo" wrote in message
...
I need help creating a sub that checks "A1" to see if it has text in the
cell, and if so run routine A Else routine B.

Any help is always appreciated.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 252
Default Text Sub

Sub Test1()
If Application.WorksheetFunction.IsText(Range("A1")) Then
MsgBox "It's text type"
routine A
Else
routine B
End If

End Sub

"Ronbo" wrote:

I need help creating a sub that checks "A1" to see if it has text in the
cell, and if so run routine A Else routine B.

Any help is always appreciated.

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
Using TEXT and &TEXT - display numbers with commas, underline text Gary Excel Discussion (Misc queries) 3 May 5th 23 03:46 AM
Text does not display in "Text boxs" and when wrapping text in a c Esteban Excel Discussion (Misc queries) 1 March 8th 07 11:59 PM
Counting a mixed text/number column based on text in another colum Sierra Vista Steve Excel Discussion (Misc queries) 3 December 17th 06 05:30 PM
Text not continuing to wrap for large block of text in Excel cell Mandra Charts and Charting in Excel 1 May 15th 06 07:13 PM
extracting text from within a cell - 'text to rows@ equivalent of 'text to columns' Dan E[_2_] Excel Programming 4 July 30th 03 06:43 PM


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