Hobolord
Board Regular
- Joined
- Sep 9, 2015
- Messages
- 64
Hello,
I am trying to create a report from two separate .xls files. I want a macro to open these two files from a button form so that the end user does not have to manually open any files.
The two separate files will be named by month and date in the format "MMM-YY". For example. if it is August 2015, I want the files Jul-15.xls and Jun-15.xls to be opened. If it is January 2017, I want Dec-16.xls and Nov-16.xls to be opened.
I have considered using Inputbox for this and having the user enter in the date, but that would require them to put the date in the correct format "MMM-YY", and I also couldn't figure out how to have the month before that be opened as well without doing a second Inputbox.
Is there a way for VBA to recognize the date and know which files I want opened, or is there another method using Inputbox that wouldn't require two separate boxes?
Thanks in advance for your help!
I am trying to create a report from two separate .xls files. I want a macro to open these two files from a button form so that the end user does not have to manually open any files.
The two separate files will be named by month and date in the format "MMM-YY". For example. if it is August 2015, I want the files Jul-15.xls and Jun-15.xls to be opened. If it is January 2017, I want Dec-16.xls and Nov-16.xls to be opened.
I have considered using Inputbox for this and having the user enter in the date, but that would require them to put the date in the correct format "MMM-YY", and I also couldn't figure out how to have the month before that be opened as well without doing a second Inputbox.
Is there a way for VBA to recognize the date and know which files I want opened, or is there another method using Inputbox that wouldn't require two separate boxes?
Thanks in advance for your help!