Referencing Data to an everchanging source name

jpb104

New Member
Joined
Jun 27, 2017
Messages
14
Hello,

I am trying to export data sets from 3 files into a new "Weekly Summary" file. However, the file names change each week to match up with the start date of the week (ex. Line 1 6-26-17). Whenever I try to reference a sheet by having the user select a file by using Application.GetOpenFileName or by having an input box where the user enters the date (ex. user enters date in inputbox "startDate", code searches for 'Workbook("Line 1" & startDate) I keep getting error messages, usually "subscript out of range." Can anyone help me with this?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Also, I can post my exact code if that helps. But think I outlined my main issues with the examples.
 
Upvote 0
So my issue is I need to be able to change the name of the workbook.open function. So while "Line 1 6-19-17.xlsm" works and may work for a week of data, the next week the file I would need to access would be something like "Line 6-26-17.xlsm" and that code would not work. I need to find away to automatically update this so I don't need to go into my code and change the date every week
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
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