Hello everyone
I wanted help cleaning up the code (see below) that was created by recording a macro. For instance declaring variables and so forth and something tighter with respect to the code.
Also, I do not want the "Formulas" spreadsheet to update values upon opening ! It does not need to. I want to update values in the "Formulas" spreadsheet after pasting into it. I do not want to save the "Formulas" spreadsheet before closing it.
Option Explicit
Sub Macro3()
'
' Macro3 Macro
'
'
Workbooks.Open Filename:= _
"L:\157 Test Files for Automation\105_Report_Spreadsheet.xlsm"
Range("A1:Z50000").Select
Selection.Copy
Workbooks.Open Filename:="L:\157 Test Files for Automation\Formulas.xlsm", _
UpdateLinks:=3
Range("A1").Select
ActiveSheet.Paste
Range("A1:AV50000").Select
Application.CutCopyMode = False
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1:AV50000").Select
Selection.NumberFormat = "#,##0.00_);[Red](#,##0.00)"
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "12_31_2009"
Range("A1").Select
Application.CutCopyMode = False
ActiveWorkbook.SaveAs Filename:= _
"L:\157 Test Files for Automation\105_Report_Values.xlsm", FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
ActiveWindow.Close
Range("A1:Z50000").Select
Selection.ClearContents
ActiveWorkbook.Close
ActiveWindow.Close
End Sub
Bookmarks