Darren_workforce
Board Regular
- Joined
- Oct 13, 2022
- Messages
- 136
- Office Version
- 365
- Platform
- Windows
Below are the 2 codes I've attempted to use. Neither seems to work. I just need to copy the data from my macro workbook, generate a new blank workbook, and paste the data into that new workbook but include the conditional formatting that I have applied on the macro workbook. I have searched and searched and have tried many variations of code. I've rearrange the .PasteSpecial lines multiple ways as well but nothing seems to work.
VBA Code:
Sub newWorkbook()
Worksheets("PROD Raw").Activate
Range("A1:AJ200").Copy
Workbooks.Add
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial xlPasteFormats
Selection.PasteSpecial Paste:=xlPasteColumnWidths
Selection.PasteSpecial Paste:=xlPasteAllUsingSourceTheme, Operation:=xlNone _
, SkipBlanks:=False, Transpose:=False
End Sub
VBA Code:
Sub copy_2()
Worksheets("PROD Raw").Activate
Range("A1:AJ200").Copy
Set new_workbook = Workbooks.Add()
new_workbook.Activate
With Range("A1")
.PasteSpecial xlPasteAll
.PasteSpecial xlPasteFormats
.PasteSpecial xlPasteValues
.PasteSpecial xlPasteColumnWidths
End With
End Sub