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
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
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 | ||||||||
---|---|---|---|---|---|---|---|---|
E | F | G | H | I | J | |||
31 | Aug-04 | 5.9 | 7.6 | 13.5 | 0.44 | 86.5 | ||
32 | Sep-04 | 6.5 | 7.4 | 13.9 | 0.47 | 86.1 | ||
33 | Oct-04 | 7.0 | 6.5 | 13.4 | 0.52 | 86.6 | ||
34 | Nov-04 | 6.2 | 6.7 | 12.9 | 0.48 | 87.1 | ||
35 | Dec-04 | 6.1 | 6.4 | 12.5 | 0.49 | 87.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