Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Function ExtractString(s As String)
Dim s1 As String, ipos As Long Dim jpos As Long ipos = InStr(1, s, "_", vbTextCompare) jpos = InStr(1, s, "for", vbTextCompare) s1 = Mid(s, ipos + 1, jpos - ipos - 2) ExtractString = s1 End Function Demo'd from the immediate window: ? ExtractString("c:\test\1_South East London for May-06.xls") South East London ? extractString("c:\1_london for may-06.xls") london -- Regards, Tom Ogilvy "funkymonkUK" wrote: how would this work if i have say the following file? c:\test\1_South East London for May-06.xls would this just extract "South"? I need to extract where it came from and then mark off that the source's file has been received. -- funkymonkUK ------------------------------------------------------------------------ funkymonkUK's Profile: http://www.excelforum.com/member.php...o&userid=18135 View this thread: http://www.excelforum.com/showthread...hreadid=538371 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
help on sumproduct() - sum by searching for a common sub string in | Excel Worksheet Functions | |||
Searching for string in other cells | Excel Worksheet Functions | |||
searching and summing using string within cell | Excel Discussion (Misc queries) | |||
Searching a String | Excel Programming | |||
searching a string with a partial string | Excel Programming |