More complex open file/copy/paste question

ajs15

New Member
Joined
Jul 1, 2021
Messages
3
Office Version
  1. 365
Hi everyone

I hope you can help, please.

Every month, I create a spreadsheet which has the same naming convention e.g "Name 202101" for January, "Name 202102" for February and so on. The format and layout stays the same, the data is just updated.

I then have a master sheet which I want to keep by updating and appending the data that I look up from each of these sheets every month.

I have created the following as per my screenshot:

1. Column A contains the names I want to look up from the sheet that I open
2. You will see I created columns and basically created the reference for the sheet name for each month that I can use with an INDIRECT function.
3. I have created code to open the sheet based on the YYYYMM input I select in cell B1

The issue is, because the formula in column J has an INDIRECT function, I can't just copy it across to all months and have it update when I open the respective sheet, I get #REF errors. So what I was thinking of doing is open the respective sheet first as step 1 and then copy the formula from column J across to the right destination column as per the input in B1 which will then (if the right sheet is open) allow the data to update and pull from the sheet that is opened.

This might definitely not be the most eloquent solution but this is what I've constructed. The basis of it all is that I want to open a sheet based on a date that I select, have certain fields in column A being looked up in that sheet and pasted in the right column in the time series.

Hope it makes sense. I have attached a screenshot.

Thanks in advance!
 

Attachments

  • Example.PNG
    Example.PNG
    30.6 KB · Views: 2

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
I think I've complicated things too much for myself and might have found a way, thank you!
 
Upvote 0

Forum statistics

Threads
1,214,650
Messages
6,120,736
Members
448,988
Latest member
BB_Unlv

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