Instead of:
You can use:
Dollar signs are not needed, and there is no need to select.
This will cause an error if a number is not entered, or if they press cancel. Cancel returns an empty string.
So, you would be better off making the variable a string, then testing it to see if the string has a number for you.
The following is the wrong approach.
You should just open the file as a workbook.
Of course, none of the above suggestions answers your question.
So what I need the macro to do is to copy and paste the desired number of worksheets from the "datafile" into the Masterfile, based on the answer the user gives for how many quarters of data they would like to pull into the Masterfile.
I'm not following you here.
The master file is: NIC AL data Masterfile, yes?
The data file is: NIC vs Ventas Comparison, yes?
All I found in this second file was:
Care Mix Choices:
AL
IL
SNF
That doesn't look like much to copy.
So I wonder if you uploaded the right file?
But assuming that the data file has data, the data will look like what is in the master file yes?
The master file has worksheets, one for each quarter yes?
And so, you are wanting to add new quarter worksheets to the master file, yes?
Why do you need to ask a user which quarter worksheet to add?
Shouldn't you add all new quarter worksheets to the master file?
Bookmarks