Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copying and then reselecting a workbook with VBA

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,



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
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,


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copying workbook formating to a differnent workbook Roger Excel Worksheet Functions 0 October 30th 09 05:27 PM
Copying Formulas from Workbook to Workbook Rupert[_2_] Excel Discussion (Misc queries) 3 June 4th 07 03:44 PM
How do I hide and unhide the same columns without reselecting CJE Excel Worksheet Functions 2 March 31st 06 12:27 AM
Copying A Worksheet From Each Open Workbook to an new Workbook carl Excel Worksheet Functions 1 January 3rd 06 05:37 PM
Copying charts from workbook to workbook Geoff C Charts and Charting in Excel 2 March 13th 05 05:04 AM


All times are GMT +1. The time now is 01:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"