PC Review


Reply
Thread Tools Rate Thread

Create a Macro to update File and Worksheet References in Formulas

 
 
Padrager
Guest
Posts: n/a
 
      11th Dec 2007
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 With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      11th Dec 2007
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
using worksheet references in formulas -sb Microsoft Excel Misc 2 27th Jul 2006 09:26 PM
Dynamic formulas including worksheet references lars22222 Microsoft Excel Worksheet Functions 1 26th Jul 2005 02:33 PM
How do I create a macro, that references another excel file ??? =?Utf-8?B?QXJpZXM=?= Microsoft Excel Worksheet Functions 1 25th May 2005 11:37 AM
Replicating Formulas with Various Worksheet References =?Utf-8?B?Q2xvdWRidXJzdDk5?= Microsoft Excel Worksheet Functions 1 20th Jan 2005 11:15 PM
Replicating Worksheet References in Formulas =?Utf-8?B?Q2xvdWRidXJzdDk5?= Microsoft Excel Worksheet Functions 2 18th Jan 2005 09:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:30 AM.