Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Defining a Function
Hi, I have a list as follows:
USA-- UK-- JAPAN-- I need to define a function which will return USA UK JAPAN I have tried the following but I think it needs some tweaking - thks for help Function taz(x) Dim i As Long i = InStr(x, "--") char = Trim(Left(cell, i - 1)) End Function |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Defining a Function
Try:
Function taz(str as String) taz = Left(str, Len(str) - 2) End Function -- Rob van Gelder - http://www.vangelder.co.nz/excel "teresa" wrote in message ... Hi, I have a list as follows: USA-- UK-- JAPAN-- I need to define a function which will return USA UK JAPAN I have tried the following but I think it needs some tweaking - thks for help Function taz(x) Dim i As Long i = InStr(x, "--") char = Trim(Left(cell, i - 1)) End Function |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Defining a Function
Function taz(x)
Dim i As Long i = InStr(x, "--") taz = Trim(Left(x, i - 1)) End Function assume A1 contains USA-- in B1 put in =taz(A1) then drag fill down the column. Or you can select column A and do Edit=Replace What -- With leave blank click replace all. -- Regards, Tom Ogilvy "teresa" wrote in message ... Hi, I have a list as follows: USA-- UK-- JAPAN-- I need to define a function which will return USA UK JAPAN I have tried the following but I think it needs some tweaking - thks for help Function taz(x) Dim i As Long i = InStr(x, "--") char = Trim(Left(cell, i - 1)) End Function |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
offset function in defining name | Excel Worksheet Functions | |||
Help defining a user-defined function | New Users to Excel | |||
Name Defining | Excel Discussion (Misc queries) | |||
Defining Cell namse after they are used in a function | Excel Worksheet Functions | |||
Defining | Excel Discussion (Misc queries) |