Worksheet copy problem

  • Thread starter Thread starter Matt
  • Start date Start date
M

Matt

I would like to copy a worksheet to a new workbook using
direct syntax...unfortunately the activeworkbook does not
change to the new workbook when I do so...I would prefer
not to use the Worksheets("Sheet1") approach and instead
use wks (such as set wks = wkb.worksheets(1))

Here is my

Set wkb = thisworkbook
set wks = wkb.worksheets(1)
wks.copy

msgbox ActiveWorkbook.name

How can I make the ActiveWorkbook name change to the
newly created workbook

Thanks

Matt
 
I don't understand. When you do this you copy the sheet to a new wb. You can
then add the line

activeworkbook.name="whateveryouwanttonameit"
or use a saveas
 
Is there something special about where the code is? Is it in a General module?

Is there anything special about wkb.worksheets(1)?

Does
msgbox activesheet.parent.name
work?

In most cases, the newly created sheet will be the activesheet and the
activeworkbook will be that new workbook.
 
Back
Top