LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default Extracting just middle text

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 :)
 
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
Add a character to the middle of a text string Glynn Taylor Excel Discussion (Misc queries) 3 April 3rd 23 02:38 PM
Adding contents of another cell to the middle of a line of text [email protected] Excel Worksheet Functions 1 September 22nd 08 08:06 PM
How to extract text from middle of a string Makelei Excel Worksheet Functions 18 July 9th 08 09:03 PM
Extract text in middle using Mid and Find or Search Karin Excel Discussion (Misc queries) 5 January 24th 08 08:01 AM
Can you put a formula in the middle of text? Weasel Excel Discussion (Misc queries) 6 March 24th 06 10:18 AM


All times are GMT +1. The time now is 01:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"