Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Create a Macro to update File and Worksheet References in Formulas

I need to create a macro that will update the file name and worksheet (tab)
references for all formulas within a range. I already have set up form drop
down boxes for the users to select the file and worksheet reference. I need
the VBA coding that will capture the users inputs and complete a find/replace
on all of the formulas for file name/worksheet. Would anyone provide the code
or point me in the direction of where this has been discussed previously?
Much Thanks!!!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Create a Macro to update File and Worksheet References in Formulas

Sub replaceformula()

OldFile = "OldFile"
NewFile = "NewFile"
OldSheetName = "OldSheet"
NewSheetName = "NewSheet"

Set ReplaceRange = Range("A1:G7")
ReplaceRange.Replace What:=OldFile, _
Replacement:=NewFile, _
SearchOrder:=xlByColumns, _
MatchCase:=True
ReplaceRange.Replace What:=OldSheetName, _
Replacement:=NewSheetName, _
SearchOrder:=xlByColumns, _
MatchCase:=True

End Sub


"Padrager" wrote:

I need to create a macro that will update the file name and worksheet (tab)
references for all formulas within a range. I already have set up form drop
down boxes for the users to select the file and worksheet reference. I need
the VBA coding that will capture the users inputs and complete a find/replace
on all of the formulas for file name/worksheet. Would anyone provide the code
or point me in the direction of where this has been discussed previously?
Much Thanks!!!!

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
Copy of a Worksheet Does Not Update Chart References HoboDan Excel Worksheet Functions 0 February 3rd 09 06:12 PM
Update References in Formulas when Columns are Inserted and Rows are Skipped Arnold[_3_] Excel Programming 4 February 3rd 07 05:00 PM
Adding a row to worksheet does not update cell references in another. blausen Excel Worksheet Functions 5 February 25th 06 09:14 PM
How do I create a macro, that references another excel file ??? Aries Excel Worksheet Functions 1 May 25th 05 11:37 AM
Create a Worksheet by getting datas from the txt file with Macro Mansoor Ali Excel Programming 0 April 19th 05 10:01 AM


All times are GMT +1. The time now is 11:37 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"