returning workbook name
Gosh that was quick! Thanks all.
"Patrick Molloy" wrote in message
...
msgbox ActiveWorkbook.Name
this returns the name of the currently active workbook
msgbox ThisWorkbook.Name
this returns the name of the workbook that is running the code
So if code is running in Book1 but book2 is active, then the first msgbox
gives Book2 and the second gives Book1
x=3
msgbox Workbooks(x).Name
DIM WB as Workbook
FOR EACH WB in Workbooks
Debug.Priint WB.Name
NEXT
"Saladin" wrote:
Hi
How do I return the name of my current workbook in code? Just the name
...
path not essential.
Thanks
Graeme
|