I have the following VBA code and I just want to eliminate selecting the sheet that the data is pasting to and just pasting it directly there instead.
Maybe there is a way to clean up some of the paste specials at the same time? Thanks
Maybe there is a way to clean up some of the paste specials at the same time? Thanks
Code:
Sub Pastedatatab()
'
' Pastedatatab Macro
'
'
ActiveWorkbook.Unprotect "secret"
Worksheets.Add(After:=Worksheets(1)).Name = "DataValues"
Sheets("Data").Range("A1:AK369").Copy
Sheets("DataValues").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
'Sheets("DataValues").Delete
'ActiveWorkbook.Protect Password:="secret", Structure:=True, Windows:=False
End Sub