Adjust value depending on month selected in sheet

jason7579

New Member
Joined
May 19, 2015
Messages
19
Office Version
  1. 365
Platform
  1. Windows
I am trying to create a master document that itemizes all of the stationery ordered from a branch within a particular month.

I currently have a spreadsheet for each branch that lists the product code, description and quantity for all stationery. Each branch has exactly the same information (except for quantity) and the spreadsheet is split into tabs for each of the 12 months.

Instead of having 12 master sheets (one per month) and referencing to every cell I would like to keep one master sheet in which I can enter the month name on the first page so that the cells update accordingly.

So basically instead of the following:
='\\SHAREPOINT LOCATION\[Stationery Branchname 2017 18.xls]April'!C2

I want the text April to refer to a cell E2 where I will manually input the month name as desired.

Is this possible? (Sorry for any confusion, I find it hard to explain exactly what is needed).

Thanks
Jason
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Try adjusting:
Rich (BB code):
Dim strPath as String

strPath = "='\\SHAREPOINT LOCATION\[Stationery Branchname 2017 18.xls]@month'!C2"
strPath = Replace(strPath, "@month", cells(2, 5).Value)
 
Last edited:
Upvote 0
Thanks for this, any chance you could give me a little guidance on how to use it. I am fine putting formulas into cells but I struggle a little when it comes to vbasic etc.
 
Upvote 0
My mis-understanding, thought you wanted code. As formula, try:
Rich (BB code):
=INDIRECT("'\\SHAREPOINT LOCATION\[Stationery Branchname 2017 18.xls]"&$E$5&"'!C2")
 
Upvote 0
Solution
Thank you very much for your help. Unfortunately this only appears to be working when both workbooks are open, when the document saved in the SharePoint location is closed I get a #REF ! error in the destination sheet.

I have tried to look into this a little further and by all accounts it seems that VBA is the only way to get exactly what I am looking for. It is about time that I learnt a bit more and expanded my knowledge of VBA in excel so this is a good starting point.
 
Upvote 0
Good luck and yes I do not believe Excel worksheets can read data from closed workbooks
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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