Hi
I have 3 files are opned. The one I am working on is called Book1 (default name did not change it or saved it yet). Then using Worksheets.add I added Book2 and then using Worksheet.add.saveas, I added 1.xlsx
Now after this running the code below
1.xlsx is the one which is protected now. My question how do I know 1.xlsx is workbooks(3). Lets say I created 10 workbooks and named them different, how can I know which one is workbooks(1) or workbooks(2) etc. If I want to use workbooks() in my code?
Also please if you do not mind. I know a workbook with name hello.xlsx can be refer in VBA as this
workbooks(1)
workbooks("hello.xlsx")
what else I can use to refer to the first workbook. I am trying to compare that with sheet. In sheets we can refer to the first sheet as this
Sheet1
Worksheets(1)
Worksheets("hello")
Thank you very much.
Bookmarks