Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default IF Functions for Text in Excel 2000

I am trying to separate city, state, zip from 1 cell to 3 by using the IF
function. But I cannot get the IF function to recognize text values, only
numeric. I have already changed the cells format to text, but to no avail.
Any suggestions? Can it be done in excel?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default IF Functions for Text in Excel 2000

Hi
see your other post

--
Regards
Frank Kabel
Frankfurt, Germany

BarnyardJoe wrote:
I am trying to separate city, state, zip from 1 cell to 3 by using
the IF function. But I cannot get the IF function to recognize text
values, only numeric. I have already changed the cells format to
text, but to no avail. Any suggestions? Can it be done in excel?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default IF Functions for Text in Excel 2000

if you are using xl2000 or later

Sub Addr()
Dim sStr As String, v As Variant
Dim lCity As Long, zip As String
Dim city As String, state As String
sStr = "Los Angeles, CA 90210"
Range("A1").Value = sStr
v = Split(Range("A1").Value, " ")

lCity = UBound(v) - 2
zip = Trim(v(UBound(v)))
state = Trim(v(UBound(v) - 1))
city = ""
For i = 0 To lCity
city = city & Trim(v(i)) & " "
Next
city = Trim(Replace(city, ",", ""))
Debug.Print city, state, zip

End Sub

for string like

Los Angeles, CA 90210


--
Regards,
Tom Ogilvy


"BarnyardJoe" wrote in message
...
I am trying to separate city, state, zip from 1 cell to 3 by using the IF
function. But I cannot get the IF function to recognize text values, only
numeric. I have already changed the cells format to text, but to no

avail.
Any suggestions? Can it be done in excel?



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
Need help with Excel 2000 text-related functions Joan A Excel Worksheet Functions 7 February 3rd 08 10:36 PM
Excel 2000 - Formulas and Functions DeeW Excel Discussion (Misc queries) 4 August 10th 06 07:00 PM
Excel 2000 Functions Tony Harris Excel Worksheet Functions 0 November 10th 04 11:18 AM
Excel 2000 calling functions in C++ um Excel Programming 13 June 2nd 04 11:31 PM
Functions not executing in Excel 2000 Philip Edwards Excel Programming 2 December 7th 03 09:17 PM


All times are GMT +1. The time now is 06:42 PM.

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"