LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 68
Default IF THEN ELSE question

Hi,

I have following code:
Sub auto()

Dim txt As String
Range("A3").Formula = "=mid(trim(a2),16,5)"
txt = Range("A3").Value

If txt = "TRIAL" Then
Application.Run ("text2colGL")
Else
If txt = "AR AG" Then
Application.Run ("txt2colAR")
Else
Application.Run ("text2col")
End If
End If

End Sub

How can I avoide placing the mid/trim function in cell A3.
If I use:
text = mid(trim(range("A2"),16,5)

it doesn't give me the same value.

Cheers,

Harold
 
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
ANother Question N.F[_2_] Excel Discussion (Misc queries) 1 June 30th 07 12:53 AM
Not sure how to do this, not even sure how to ask the question clearly... rich Excel Worksheet Functions 4 May 7th 06 01:30 PM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
The question is an excel question that I need to figure out howto do in excel. Terry Excel Worksheet Functions 3 January 23rd 06 06:22 PM
Last question! Deadloss Excel Discussion (Misc queries) 2 December 22nd 05 11:02 PM


All times are GMT +1. The time now is 09:54 PM.

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"