excel - Refer to a workbooks by index number -


i using

set newbook = workbooks.add 

to create new workbook. need refer workbook without saving it. using workbook index number refer new workbook, there way retrieve index number of last workbook open/created (the highest index number)?

you can use last workbook

set lastworkbook = workbooks(workbooks.count) 

but if have newbook variable, can't use that? reason because relying on workbook's index may not give consistent results.


Comments

Popular posts from this blog

javascript - How to process users in one specific order using map o each function? -

java - Two interface have same method name with different return type -

javascript - Linking from page A to a specific iframe on page B -