ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy and paste the worksheet to New workbook.. (https://www.excelbanter.com/excel-programming/299559-copy-paste-worksheet-new-workbook.html)

Sudarshan[_3_]

Copy and paste the worksheet to New workbook..
 
Hi,

I am able to copy and paste the worksheet to new worksheet
in new workbook. But i have one problem. The worksheet
which I am copying is having VBA Code behind it. When i do
copy paste , VBA code also copies to new workseet. I do
not want the VBA code to be copied..

Any solution...

My Existing Code

Workbooks("Book1").Sheets("Sheet1").Copy
Befo=Workbooks("Book2").Sheets(1)
' This is for remove the formulas.
ActiveSheet.UsedRange = ActiveSheet.UsedRange.Value


Sudarshan

Frank Kabel

Copy and paste the worksheet to New workbook..
 
Hi
take a look at
http://www.cpearson.com/excel/vbe.htm

to delete the code


--
Regards
Frank Kabel
Frankfurt, Germany


Sudarshan wrote:
Hi,

I am able to copy and paste the worksheet to new worksheet
in new workbook. But i have one problem. The worksheet
which I am copying is having VBA Code behind it. When i do
copy paste , VBA code also copies to new workseet. I do
not want the VBA code to be copied..

Any solution...

My Existing Code

Workbooks("Book1").Sheets("Sheet1").Copy
Befo=Workbooks("Book2").Sheets(1)
' This is for remove the formulas.
ActiveSheet.UsedRange = ActiveSheet.UsedRange.Value


Sudarshan



All times are GMT +1. The time now is 08:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com