Reference a previous worksheet

AlanKel

New Member
Joined
Mar 10, 2011
Messages
3
I need to keep track of my mileage in the work van, by taking note of it the same day each week. The expenses here are done on an excel file, one worksheet per week.

Example
http://img9.imageshack.us/img9/3157/expenses.jpg

I want to put in a formula for the "Start km" for each week to show the "End km" of the previous week. I know to do it for one week would be to use

=wk9!H29

But to do this for the rest of the year would be annoying changing the formula to wk10, wk11 etc...

Is there a way to just have

=previousworksheet!H29 or =(ThisSheet -1)!H29 or something like that?

Thanks :)
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
That's great thanks for the quick reply. Would I put the code for that function in the regular Microsoft Visual Basic code editor in the "This Workbook" section? I've tried that but I'm getting the "#NAME?" error in the cell I put "=sheetoffset(-1,A1)"

As for your idea for keeping everything on the same worksheet. That one is out of my hands, the boss wants them all kept on separate worksheets the way he set them up. I'm just trying to make it a little easier for myself with bits and pieces of code here and there.

Thanks :)
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,671
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top