View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ctech[_56_] Ctech[_56_] is offline
external usenet poster
 
Posts: 1
Default copy sheets in workbook to new workbook


This macro is to copy a wb, sheet by sheet into a new blank wk, without
formulas.
I doing this as each page have several formulas and are sheet
protected.


What happens is that the macro so everything correct, except that it
pasts blank sheets.

Please help

Macro:


Sub Copywkbookvalues()
Dim Morg
Dim Mto
Dim tWbk As Workbook
Dim cWbk As Workbook
Dim Sht As Worksheet

Set tWbk = ActiveWorkbook

Workbooks.Add
ActiveWorkbook.SaveAs Filename:= _
"X:\Users\Shared\GENERAL\Christian S\05.11.23 - Budget
Uploading LBUD3\BFR\Copy of file.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False


Set cWbk = ActiveWorkbook


On Error Resume Next
tWbk.Activate
For Each Sht In Worksheets
Sht.Select
Sht.Cells.Select
Selection.Copy
cWbk.Sheets.Add
ActiveSheet.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False



Next


End Sub


--
Ctech
------------------------------------------------------------------------
Ctech's Profile: http://www.excelforum.com/member.php...o&userid=27745
View this thread: http://www.excelforum.com/showthread...hreadid=487689