Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cell references in excel vba code Isis[_2_] Excel Discussion (Misc queries) 4 April 26th 10 01:10 PM
change formula references from one tab to another [email protected] New Users to Excel 1 November 3rd 08 06:04 PM
How to change lookup references Guy Yeakley Excel Worksheet Functions 1 January 25th 06 02:24 PM
Relative Cell References within VBA code Jandy Excel Discussion (Misc queries) 2 April 21st 05 02:17 AM
syntax question - cell references in VB code needyourhelp New Users to Excel 1 March 2nd 05 08:52 PM


All times are GMT +1. The time now is 10:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"