VBA Getting workbook name and activate the workbook
In Excel, if you have been opened more than one file, then one file must be active when you are working in Excel and in another in the background.
So to get the workbook name you can write the code in VBA as given below.
I think you found this helpful if you write the code in your VBA editor on your own you will get a better idea about how this works and your understanding becomes clearer.
Related: Excel VBA common basic questions
Related: How to Record, Run and Save Macro
Written by: Kalpesh Agrawal (Actuarial Intern - IIB)