VBA Paste Special Error

nah89

New Member
Joined
Aug 9, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
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.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
I do not see where you copied anything.
I do not believe you can use cut and then paste.
You need to use copy then paste.
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top