Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Locate and length functions

I am looking for a locate function, WHat I need to do is
find the length of a string up to the first instance of
particular character and determine how many characters are
before it, then use that result in a left statement

something like

x=length(string,locate("-"))
left(string,x)

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default Locate and length functions

Nigel

Try the InStr() function

InStr(1,"Nick Hodge","o")

returns 7

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS

"Nigel Bennett" wrote in message
...
I am looking for a locate function, WHat I need to do is
find the length of a string up to the first instance of
particular character and determine how many characters are
before it, then use that result in a left statement

something like

x=length(string,locate("-"))
left(string,x)



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Locate and length functions

x = Instr(String,"-")
y = left(string,x)

--
regards,
Tom Ogilvy

"Nigel Bennett" wrote in message
...
I am looking for a locate function, WHat I need to do is
find the length of a string up to the first instance of
particular character and determine how many characters are
before it, then use that result in a left statement

something like

x=length(string,locate("-"))
left(string,x)



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Locate and length functions

Try the find function in Excel or the instr() in VBA

"Nigel Bennett" wrote:

I am looking for a locate function, WHat I need to do is
find the length of a string up to the first instance of
particular character and determine how many characters are
before it, then use that result in a left statement

something like

x=length(string,locate("-"))
left(string,x)


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
How to locate the value? Eric Excel Discussion (Misc queries) 1 August 30th 09 06:27 PM
Length that falls within a length interval? Igorin Excel Worksheet Functions 4 November 20th 08 06:10 PM
Validation length, Range length I think I need to rephrase the question Excel Discussion (Misc queries) 5 September 17th 07 06:29 AM
STILL CAN'T LOCATE XML emi New Users to Excel 1 July 24th 07 11:04 PM
Locate max value cell Kevin Excel Programming 1 December 10th 03 05:05 PM


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