"The Paste method of the Worksheet class failed."
Solved
Hello everyone,
I'm encountering a simple VBA error during an ActiveSheet.Paste. Here is my code:
And the error occurs on "ActiveSheet.Paste"
Thanks in advance for your help everyone!
I'm encountering a simple VBA error during an ActiveSheet.Paste. Here is my code:
Dim Cel_reso As Range Set Cel_reso = Cells.Find(What:="Resolution") If Not Cel_reso Is Nothing Then Cells(1, Cel_reso.Column).Resize(Cells(Rows.Count, Cel_reso.Column).End(xlUp).Row).Cut Columns("A:A").Insert Shift:=xlToRight Range("A1").Select ActiveSheet.Paste End If And the error occurs on "ActiveSheet.Paste"
Thanks in advance for your help everyone!
2 answers
-
Hello,
The following code is sufficient:
Dim Cel_reso As Range
Set Cel_reso = Cells.Find(What:="Resolution")
If Not Cel_reso Is Nothing Then
Cells(1, Cel_reso.Column).Resize(Cells(Rows.Count, Cel_reso.Column).End(xlUp).Row).Cut
Columns("A:A").Insert Shift:=xlToRight
Range("A1").Select
End If
See you! -
It works perfectly, thank you very much!
Have a great day.