I have hit a wall in trying to find a solution to my problem. Here is a summary of what I am trying to do:
Situation: I receive 4 identical worksheets weekly and I need to combine data on my summary worksheet:
| Year | Week | Town 1 | Town 2 | Town 3 | Town 4 |
|---|---|---|---|---|---|
| 2021 | Week 1 | ||||
| 2021 | Week 2 |
Worksheets: I receive identical worksheets weekly with paths to the cell I need to pull looking like this:
A:\Network\2021\Week 1[Town 1.xlsx]Sheet1'!$D$4'
A:\Network\2021\Week 1[Town 2.xlsx]Sheet1'!$D$4'
A:\Network\2021\Week 1[Town 3.xlsx]Sheet1'!$D$4'
A:\Network\2021\Week 1[Town 4.xlsx]Sheet1'!$D$4'
Idea/Solution:
User wants to populate data from Week 1:
User is prompted with InputBox to enter Year and Week which will become variables in a file path to pull data
Inputs would create file path: A:\Network\ Year Input \ Week Input \ [Header.xlsx]Sheet1'!$D$4'
Then using that input pull the data from each workbook
Where I'm at now:
From my research it seems that I would have to use vba to achieve this but i'm not an expert, would you happen to know a simpler method or let me know if I'm on the right track with my code?
Sub AddANewWeek ()
' ------------- Town Summary Worksheet -------------
Application.ScreenUpdating = False
Worksheets("Town Summary").Activate
Dim Town_Summary As Worksheet
Set Town_Summary = Worksheets("Town Summary")
'------------- User inputs the name of the Year-Week to extract the data -------------
On Error GoTo ErrorMessage
Dim myYear As Variant
myYear = InputBox("Please enter the Year to extract data:")
On Error GoTo ErrorMessage
Dim myWeek As Variant
myWeek = InputBox("Please enter the Week to extract data:")
