Extracting just middle text
hi,
Look up the =mid function in help
it looks like to me it would be
=mid(b91,20,8) this formula would be in H3.
Regards
Frank
-----Original Message-----
How can I extract the middle word in a cell ? I'm copying
the value from cell
"B91" and pasting in "H3"
the original value shows
C:\elandata\Dataset\101504-1\Blank.001
I need to keep 101504-1
I got the first part working: 101504-1\Blank.001
How can I get rid of \Blank.001? I don't know how many
characters are going
to be after "\", it changes all the time.
Sub GetName ()
Dim X As String
Dim inside As Long
Dim D As String
Range("H3").Value = Range("B91").Value
X = Range("H3").Value
inside = InStr(X, "\")
D = (Trim$(Mid$(X, inside + 18)))
Range("H3").Value = D
End Sub
Thanks in advance
--
gaba :)
.
|