Copying and then reselecting a workbook with VBA

  • Thread starter Thread starter Big Chris
  • Start date Start date
B

Big Chris

Hello!

Thanks for at least looking at my request....

I have a workbook and I have recorded a macro to copy a sheet to a new
workbook and then paste the values to get rid of all the formulae.
I then want to return to the original workbook to make further changes
with the same macro. Problem is, the original worksheet may not have
been saved under a common name. It there a way with VBA to reselect the
original sheet regardless of its name?

Everything works fine with a known workbook name specified in the
macro.


Many thanks,
 
Dim wSht as WorkSheet
Dim wBk as WorkBook

Set wSht = ActiveSheet
Set wBk = ActiveWorkbook

' Your sheet copy code.

wBk.Activate
wSht.Activate

HTH
Paul
---------------------------------------------------------------------------------
 
Back
Top