Hello,
Im trying to fix an error I'm getting on my macro I'm getting the 1004 paste special error and I'm not entirely sure how to fix it.
Sub Macro1()
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Sheet1")
With ws
.Range("A2:C3").ClearContents
.Range("E2:H2").ClearContents
.Columns("E:F").Delete Shift:=xlToLeft
.Columns("G:G").Delete Shift:=xlToLeft
.Columns("I:J").Delete Shift:=xlToLeft
.Columns("M:Q").Delete Shift:=xlToLeft
.Range("A1:D1").Value = "Client Remittance Report For Talen Energy LLC"
.Range("I2:K2").Cut
.Range("A2").PasteSpecial xlPasteValues
.Columns("L:L").Delete Shift:=xlToLeft
.Range("N2:P2").Cut
.Range("L2").PasteSpecial xlPasteValues
.Range("L3:L" & .Cells(.Rows.Count, "L").End(xlUp).Row).Cut
.Range("F2").PasteSpecial xlPasteValues
.Range("M2").ClearContents
.Range("N3:N" & .Cells(.Rows.Count, "N").End(xlUp).Row).Cut
.Range("L3").PasteSpecial xlPasteValues
.Range("O3:O" & .Cells(.Rows.Count, "O").End(xlUp).Row).Cut
.Range("N3").PasteSpecial xlPasteValues
.Rows("2:2").RowHeight = 32.4
.Columns("A:A").ColumnWidth
= 31.78
Application.CutCopyMode = False
End With
End Sub
I'm not sure how to fix this at all.
Im trying to fix an error I'm getting on my macro I'm getting the 1004 paste special error and I'm not entirely sure how to fix it.
Sub Macro1()
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Sheet1")
With ws
.Range("A2:C3").ClearContents
.Range("E2:H2").ClearContents
.Columns("E:F").Delete Shift:=xlToLeft
.Columns("G:G").Delete Shift:=xlToLeft
.Columns("I:J").Delete Shift:=xlToLeft
.Columns("M:Q").Delete Shift:=xlToLeft
.Range("A1:D1").Value = "Client Remittance Report For Talen Energy LLC"
.Range("I2:K2").Cut
.Range("A2").PasteSpecial xlPasteValues
.Columns("L:L").Delete Shift:=xlToLeft
.Range("N2:P2").Cut
.Range("L2").PasteSpecial xlPasteValues
.Range("L3:L" & .Cells(.Rows.Count, "L").End(xlUp).Row).Cut
.Range("F2").PasteSpecial xlPasteValues
.Range("M2").ClearContents
.Range("N3:N" & .Cells(.Rows.Count, "N").End(xlUp).Row).Cut
.Range("L3").PasteSpecial xlPasteValues
.Range("O3:O" & .Cells(.Rows.Count, "O").End(xlUp).Row).Cut
.Range("N3").PasteSpecial xlPasteValues
.Rows("2:2").RowHeight = 32.4
.Columns("A:A").ColumnWidth
= 31.78
Application.CutCopyMode = False
End With
End Sub
I'm not sure how to fix this at all.