![]() |
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/ |
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, |
All times are GMT +1. The time now is 06:48 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com