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
Post a Comment