in VBA Sheets("mysheet").Copy Before:=Sheets(1) how do i get a reference to the newly created copy o

  • Thread starter Thread starter Daniel
  • Start date Start date
D

Daniel

in VBA Sheets("mysheet").Copy Before:=Sheets(1) how do i get a reference to
the newly created copy of this sheet?
 
Hi Daniel,

Try something like:

Dim WB As Workbook
Dim WS As Worksheet

Set WB = ActiveWorkbook
With WB
.Sheets("Mysheet").Copy Before:=.Sheets(1)
End With

Set WS = ActiveSheet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top