LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 38
Default Relative sheet referencing in excel formulas

Hi,

I'm trying to write a macro that will import a sheet from another
workbook(say, X) and then add stuff to each of the rows by using a vlookup
formula that looks in the second worksheet of the original workbook (say, Y).
The first sheet in Y will have some rows that are different to those in sheet
2 in Y but will also have some of the same ones. For those that are the same,
the vlookup will return some comments from sheet 2.

The problem, however, is that the sheet names are always different because
they come from a file that is generated on a daily basis. Is it possible to
put a relative reference into the vlookup formula that will look on the
second sheet instead of sheet(...)?

Specifically, the formula in my macro looks like this:
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-16],0529080946!RC[-16]:R[1056]C,16,FALSE)"

and I am trying to change the "0529080946!" to sheets(2) in my workbook.

Thank you in advance for your help.

Michael
 
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
Relative Cell Referencing in MS Excel [email protected] Excel Discussion (Misc queries) 1 February 21st 07 10:37 PM
Relative referencing in Microsoft Excel between worksheets SeveranceD Excel Discussion (Misc queries) 3 September 7th 06 11:39 PM
Allow relative referencing for imbedded sheetnames in formulas Ted Excel Worksheet Functions 1 March 8th 06 10:10 PM
Relative column referencing within formulas Alistair Excel Discussion (Misc queries) 4 February 23rd 06 05:38 PM
How do I turn off relative cell referencing in excel? Glenn New Users to Excel 1 April 13th 05 03:06 AM


All times are GMT +1. The time now is 04:50 AM.

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

About Us

"It's about Microsoft Excel"