Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
I want to put a list in column A that will be the paths to the files I
have, (ie c:\Program Files\Common Files\Microsoft\Stationery\signature.htm), but I wqant to delete the path in column B, so I need a formula that will delete everything to the left of "\". Can anyone help?? TIA Sheila |
#2
![]() |
|||
|
|||
![]()
You can create a formula, but I would go for a function in VBA instead.
You can do something like: Function splitName(text As String) As String txt = Split(text, "\") splitName = txt(UBound(txt)) End Function Which will return "signature.htm". Add the function to a module so that it is available in the worksheet (or create an addin with the function) Regards Robert |
#3
![]() |
|||
|
|||
![]()
Assuming your string is A1
Here is an array formula. Enter with Ctrl+Shift+Enter =MID(A1, MAX(--(MID(A1, ROW(INDIRECT("1:" & LEN(A1))), 1)="\") * ROW(INDIRECT("1:" & LEN(A1)))) + 1, LEN(A1)) I'm not that great at the ROW(INDIRECT( trick.. I've noticed some who are quite confident at it. I'd be happy to see corrections. -- Rob van Gelder - http://www.vangelder.co.nz/excel "Sheila" wrote in message ... I want to put a list in column A that will be the paths to the files I have, (ie c:\Program Files\Common Files\Microsoft\Stationery\signature.htm), but I wqant to delete the path in column B, so I need a formula that will delete everything to the left of "\". Can anyone help?? TIA Sheila |
#4
![]() |
|||
|
|||
![]()
Sheila wrote...
I want to put a list in column A that will be the paths to the files I have, (ie c:\Program Files\Common Files\Microsoft\Stationery\signature.htm), but I wqant to delete the path in column B, so I need a formula that will delete everything to the left of "\". Can anyone help?? If you need this dynamic, then use Rob's formula. If this would be mostly static, then copy the pathnames from col A into col B, then Edit Replace over col B, replacing *\ with nothing. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I delete ALL text boxes in Excel worksheets? | Excel Discussion (Misc queries) | |||
Read Text File into Excel Using VBA | Excel Discussion (Misc queries) | |||
Text to Columns from the Left | Excel Worksheet Functions | |||
Macro or Function to make text size to suite text Length? | Excel Discussion (Misc queries) | |||
Delete Columns not Containing Certain Text | Excel Worksheet Functions |