Marty the Hat
New Member
I need to write some VBA that will run some instructions in a workbook and worksheet that has a different name each month.
For example the first month I want it to select workbook named 'Marchadmits' and then in the worksheet 'admins01' add a formula to column A, the next month I want the same VBA to select workbook 'Apriladmits' and add the same formula to the worksheet 'admins02'.
Basically the VBA needs to select any workbook with '...admits' in the title and any worksheet with 'admins...' in the title regardless of the rest of the name.
I'm hoping there is a simple way of doing this but I can't figure it out at the moment, grateful for advice...
For example the first month I want it to select workbook named 'Marchadmits' and then in the worksheet 'admins01' add a formula to column A, the next month I want the same VBA to select workbook 'Apriladmits' and add the same formula to the worksheet 'admins02'.
Basically the VBA needs to select any workbook with '...admits' in the title and any worksheet with 'admins...' in the title regardless of the rest of the name.
I'm hoping there is a simple way of doing this but I can't figure it out at the moment, grateful for advice...