View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] gimme_this_gimme_that@yahoo.com is offline
external usenet poster
 
Posts: 129
Default Pulling Part of a String

Check out InstrRev

Sub t()
s = "asdfsa\asdf.txt"
ix = InStrRev(s, "\")
MsgBox ix
End Sub


RSteph wrote:
I've used the Mid and InStr functions to pull out parts of a string starting
from the left end of the string and running to the end of string (within a
cell).

Is there a way for me to go from the other direction? Start from the end of
the cell, and work my way backwards? I've got a column with a list of items
and then four sets of numbers. I want to pull the sets of numbers out into
other columns. The problem is that the item names are not uniform in length,
and some have one word names, some have 2-3 word names, so simply using
spaces, and starting points won't work for me.

I tried to look into doing something where I started from the start of the
string, and searched for the first numeric value, then work from there... but
I couldn't get that to work either.

Any help would be greatly appreciated.