Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to "Replace()" multiple characters in one VBA command line
XL 2003 & 2007
ActiveCell.formula is: ='P:\DMB\NCCRS\[$119M Distribution Summary - 3-31-2007 (4-9-2007).xls] I would like to remove =' and [ and ] in the most efficient manner. to get to a string which can be used to "Open" a file with "FilePathName" Current I do it as follows: FilePathName = replace(FilePathName,"='","") FilePathName = replace(FilePathName,"[","") FilePathName = replace(FilePathName,"]","") Is there a better way? TIA EagleOne |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to "Replace()" multiple characters in one VBA command line
One way:
FilePathName = Mid(Replace(Replace( _ FilePathName, "[", ""), "]", ""), 3) In article . com, "EagleOne" wrote: XL 2003 & 2007 ActiveCell.formula is: ='P:\DMB\NCCRS\[$119M Distribution Summary - 3-31-2007 (4-9-2007).xls] I would like to remove =' and [ and ] in the most efficient manner. to get to a string which can be used to "Open" a file with "FilePathName" Current I do it as follows: FilePathName = replace(FilePathName,"='","") FilePathName = replace(FilePathName,"[","") FilePathName = replace(FilePathName,"]","") Is there a better way? TIA EagleOne |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to cancel a find & replace command "midstream"? | Excel Worksheet Functions | |||
How to replace "#N/A" w "0"when vlookup couldn't find the match? | Excel Discussion (Misc queries) | |||
Replace dialog should put focus on "Find What" not "Replace With" | Excel Discussion (Misc queries) | |||
inserting a conditional "go to" command on a excel "if" function | Excel Worksheet Functions | |||
Can you replace "TRUE" with " " in an exact formula? | Excel Worksheet Functions |