Referencing Worksheets from the value of a cell.

BrianClough

New Member
Joined
Mar 30, 2016
Messages
19
Hi,

I'm sure this is probably very easy to do, but I have an inventory spreadsheet, which is duplicated each day. The sheet follows the date. 26112018 27112018.

The cells which reference the previous days data, are linked to the previous sheet for the date in question.

Once I duplicate the sheet the following day, all of the links are for the day before yesterday, and need to be changed so they match yesterdays date.

Is there anyway to make a formula so it builds the sheet automatically, just by changing the required date in a single cell?

Kind regards,

Brian C.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Something like this?

=HYPERLINK("#'"&TEXT(TODAY()-1,"ddmmyyyy")&"'!A1")

This will go to sheet 27112018 (Today -1) cell A1

Or to build it off a date in a cell, where B1 is a date.

=HYPERLINK("#'"&TEXT(B1,"ddmmyyyy")&"'!A1")
 
Last edited:
Upvote 0
Use the INDIRECT function

Have the date value in a cell Say... "B77" where "B77" contains "26112018"

then modify the formulas to use the indirect function.

=INDIRECT("mybasesheetname" & B77& "!A1")
=INDIRECT("mybasesheetname" & B77& "!A2")

et cetera

That way, each day, all you need to do is change the value in cell B77, or whatever one you put the date value in
 
Upvote 0
Use the INDIRECT function

Have the date value in a cell Say... "B77" where "B77" contains "26112018"

then modify the formulas to use the indirect function.

=INDIRECT("mybasesheetname" & B77& "!A1")
=INDIRECT("mybasesheetname" & B77& "!A2")

et cetera

That way, each day, all you need to do is change the value in cell B77, or whatever one you put the date value in


---

Perfect. Thank you.

=INDIRECT("" & D3& "!D6")

That got it working how I needed.
 
Upvote 0
I also have another formula, which I could do with being able to combine with an INDIRECT if possible. Where it links to the 26112018 page on the sheet, to the date I needed?

The formula is: =IFERROR(INDEX('C:\123\[RECEIVINGS.xlsm]26112018'!$K$2:$K$133,SMALL(IF('C:\123\[RECEIVINGS.xlsm]26112018'!$D$2:$D$133 = $E6, ROW('C:\123\[RECEIVINGS.xlsm]26112018'!$D$2:$D$133) - ROW(INDEX('C:\123\[RECEIVINGS.xlsm]26112018'!$D$2:$D$133,1,1)) +1), $B$6)),"0")

Would that be possible at all?

Regards,

Brian C
 
Upvote 0
With a bit of playing. Success. :)

=IFERROR(INDEX(INDIRECT("'C:\123\[RECEIVINGS.xlsm]" & $D$3 &"'!$K$2:$K$133"),SMALL(IF(INDIRECT("'C:\123\[RECEIVINGS.xlsm]" & $D$3 &"'!$D$2:$D$133") = $E6, ROW(INDIRECT("'C:\123\[RECEIVINGS.xlsm]" & $D$3 &"'!$D$2:$D$133")) - ROW(INDEX(INDIRECT("'C:\123\[RECEIVINGS.xlsm]" & $D$3 &"'!$D$2:$D$133"),1,1)) +1), $B$6)),"0")

Thanks again guys. :)
 
Upvote 0
Do some research on the EVALUATE function, that's another powerful one as well.
 
Upvote 0

Forum statistics

Threads
1,224,747
Messages
6,180,719
Members
452,995
Latest member
isldboy

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