Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 68
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default 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
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
How to cancel a find & replace command "midstream"? Matt from GVA Excel Worksheet Functions 4 September 4th 06 05:47 PM
How to replace "#N/A" w "0"when vlookup couldn't find the match? Holly Excel Discussion (Misc queries) 2 July 17th 06 11:48 PM
Replace dialog should put focus on "Find What" not "Replace With" Michael Williams Excel Discussion (Misc queries) 0 May 24th 06 12:45 PM
inserting a conditional "go to" command on a excel "if" function velasques Excel Worksheet Functions 5 March 10th 06 08:16 PM
Can you replace "TRUE" with " " in an exact formula? Sweetetc Excel Worksheet Functions 2 February 10th 06 01:11 PM


All times are GMT +1. The time now is 05:39 PM.

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

About Us

"It's about Microsoft Excel"