Find And Replace Formula in VBA Code

stucamps

Board Regular
Joined
Jul 3, 2003
Messages
114
I have a macro that copies down a formula into the row below that is linked to another xls on the system.

This is done on a quarterly basis (therefore the code below copies the formula into the 3 rows below) :
-------------------------------------------------------------------------------------
Range(ThisWorkbook.Sheets("Deadweight").Range("e11").End(xlDown), _
ThisWorkbook.Sheets("Deadweight").Range("e65536").End(xlUp).Offset(0, 5)).Copy

Range(ThisWorkbook.Sheets("Deadweight").Range("e65536").End(xlUp).Offset(1, 0), _
ThisWorkbook.Sheets("Deadweight").Range("e65536").End(xlUp).Offset(3, 5)). _
PasteSpecial Paste:=xlAll
-------------------------------------------------------------------------------------
And this is the layout on the xls
Template 2004-Q4 (PABF).xls
EFGHIJ
31Aug-045.97.613.50.4486.5
32Sep-046.57.413.90.4786.1
33Oct-047.06.513.40.5286.6
34Nov-046.26.712.90.4887.1
35Dec-046.16.412.50.4987.6
Deadweight


I want to be able to change the reference on the formula from reading the "Dec-04" tabsheet to read the "Jan-05" tabsheet on the xls that is linked in the formula in the row cells
Any help on how to use the edit replace (ctrl-h) function in VBA would be good as the cell referenced is the same in the xls so really the only change in the formula is the date in column E
Any help greatly appreciated
Thanks
Stuart
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,214,943
Messages
6,122,370
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top