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

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -