Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code to change references
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cell references in excel vba code | Excel Discussion (Misc queries) | |||
change formula references from one tab to another | New Users to Excel | |||
How to change lookup references | Excel Worksheet Functions | |||
Relative Cell References within VBA code | Excel Discussion (Misc queries) | |||
syntax question - cell references in VB code | New Users to Excel |