View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] pfsardella@yahoo.com.nospam is offline
external usenet poster
 
Posts: 172
Default Copying and then reselecting a workbook with VBA

Dim wSht as WorkSheet
Dim wBk as WorkBook

Set wSht = ActiveSheet
Set wBk = ActiveWorkbook

' Your sheet copy code.

wBk.Activate
wSht.Activate

HTH
Paul
---------------------------------------------------------------------------------
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,