Todd G. McKissick
New Member
I am trying to write a macro that will copy everything on spreadsheet, create a new workbook, and paste values and value formats. This code works when I step through it, but it does not work when I run the macro itself:
Anyone see what I'm doing wrong?
Todd
Code:
Sub Copysheet()
ThisWorkbook.Activate
Cells.Select
Selection.Copy
Dim NewCaseFile As Workbook
Set NewCaseFile = Workbooks.Add
With NewCaseFile
Cells.Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
End With
Application.CutCopyMode = False
Range("A1").Select
End Sub
Todd
Last edited by a moderator: