Code to change references

S

Steve

Currently I have:
File 1 = Summary File 2 = CCO
'[Summary.xls]May-03'!J19: ='[CCO.xls]Jan-03'!$N$467
'[Summary.xls]Jun-03'!J19: ='[CCO.xls]Jan-03'!$N$467
'[Summary.xls]Jul-03'!J19: ='[CCO.xls]Jan-03'!$N$467

What is the code to change them to:

'[Summary.xls]May-03'!J19: ='[CCO.xls]May-03'!$N$471
'[Sunnary.xls]Jun-03'!J19: ='[CCO.xls]Jun-03'!$N$472
'[Summary.xls]Jul-03'!J19: ='[CCO.xls]Jul-03'!$N$473

The code needs to change the reference on the right side of the equal sign.
1. For each line, the code needs to change the sheet name to the sheet name on
the left side of the equal sign, ie,
line 1: Jan-03 to May-03
line 2: Jan-03 to Jun-03
line 3: Jan-03 to Jul-03
The lines could be any three months so the code must be generic!

2. For each line, the row reference must be 467 + (Month# -1)in the line, ie,
In line 1, May is Month#5 so the row reference is 467 + (5-1) = 471
in line 2, June is Month#6 so the row reference is 467 + (6-1) = 472
in line 3, July is Month#7 so the row reference is 467 + (7-1) = 473

Thanks for your help!

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top