Reference different worksheets

W

WLMPilot

I have a workbook with sheets named 2005, 2006, 2007. Each sheet contains
data that matches the paychecks that my wife and I get. Each column is a
paycheck. I have another worksheet called STATS. On this sheet, I have a
form for each year (worksheet) that pulls totals from each sheet in order to
track total taxes against total income, and more. A tipical formula on the
STATS sheet used to pull this data is obviously ='2007'AB15 (which might be
YTD Income for one paycheck.

My question is this. How can I just have one form on the STATS sheet and
click on a command button, or something, in order to change the worksheet
reference from one year to another?

Thanks for your help,
Les
 
B

Bob Phillips

=INDIRECT(M1&"!AB15")

where M1 has the year number.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
S

Stan Brown

Thu, 27 Dec 2007 07:21:01 -0800 from WLMPilot
I have a workbook with sheets named 2005, 2006, 2007. Each sheet contains
data that matches the paychecks that my wife and I get. Each column is a
paycheck. I have another worksheet called STATS. On this sheet, I have a
form for each year (worksheet) that pulls totals from each sheet in order to
track total taxes against total income, and more. A tipical formula on the
STATS sheet used to pull this data is obviously ='2007'AB15 (which might be

I don't think so. I think it's ='2007'!AB15 .
YTD Income for one paycheck.

My question is this. How can I just have one form on the STATS sheet and
click on a command button, or something, in order to change the worksheet
reference from one year to another?

If you don't want to write a macro, use INDIRECT("'" & A1 & "'!AB15")
where A1 (on the current worksheet) contains the year number.
 

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