How to "Replace()" multiple characters in one VBA command line

  • Thread starter Thread starter EagleOne
  • Start date Start date
E

EagleOne

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
 
One way:

FilePathName = Mid(Replace(Replace( _
FilePathName, "[", ""), "]", ""), 3)
 
Back
Top