Thymen
02-27-2006, 02:57 PM
Hi folks,
I use the code below to copy sheets from the active workbook to another. However... that if that sheet contains VB code, that is also copied. Is there an option to copy WITHOUT code?
Sub CopySheets()
Dim BkName As String
Dim NumSht As Integer
Dim BegSht As Integer
BegSht = 1
NumSht = 6
BkName = ActiveWorkbook.Name
For x = 1 To NumSht
Workbooks(BkName).Sheets(BegSht).Copy _
Before:=Workbooks("Test.xls").Sheets(1)
Next
End Sub
Greetings,
Thymen
I use the code below to copy sheets from the active workbook to another. However... that if that sheet contains VB code, that is also copied. Is there an option to copy WITHOUT code?
Sub CopySheets()
Dim BkName As String
Dim NumSht As Integer
Dim BegSht As Integer
BegSht = 1
NumSht = 6
BkName = ActiveWorkbook.Name
For x = 1 To NumSht
Workbooks(BkName).Sheets(BegSht).Copy _
Before:=Workbooks("Test.xls").Sheets(1)
Next
End Sub
Greetings,
Thymen