C
Chris Watts
I am attempting to copy a single sheet from one workbook into a new workbook
and save it - keeping the original unchanged.
When I use the code below it does indeed create a new workbook and copy the
required sheet into it. But the active cell from the original now appears
in the new workbook .contaiing a few lines of vba (not mine!). Also the
original workbook seems to have been renamed. Suggestions welcomed!
TIA
Chris
Sub SaveReport()
Dim strFilename As String
If strActivePieceNo = "" Then Call WhatPieceNumber
strFilename = "Report on Piece No " & strActivePieceNo
Sheets("Consistancy Report").Paste
ActiveWorkbook.SaveAs (strFilename)
End Sub
[Note strActivePieceNumber is a global defined and set elsewhere]
and save it - keeping the original unchanged.
When I use the code below it does indeed create a new workbook and copy the
required sheet into it. But the active cell from the original now appears
in the new workbook .contaiing a few lines of vba (not mine!). Also the
original workbook seems to have been renamed. Suggestions welcomed!
TIA
Chris
Sub SaveReport()
Dim strFilename As String
If strActivePieceNo = "" Then Call WhatPieceNumber
strFilename = "Report on Piece No " & strActivePieceNo
Sheets("Consistancy Report").Paste
ActiveWorkbook.SaveAs (strFilename)
End Sub
[Note strActivePieceNumber is a global defined and set elsewhere]