Error, the PasteSpecial method of the Range class failed.
Solved
JoeLaBricole
-
JoeLaBricole -
JoeLaBricole -
Hello everyone,
The macro below is used to copy a list created by the user by selecting a variable number of products. This list is in column B of the Recap sheet. Once copied, this list is pasted into the General sheet starting from cell N2.
This macro fails on the paste line, when it reaches: ".Range("N2")....." the macro gives the following message: Error, The PasteSpecial method of the Range class has failed
What troubles me is that if I move the macro's indicator to: " With Worksheets("Recap") " and press F5, the macro runs without any problems.
So, who can help me?
PS: I also tried with: ActiveSheet.Paste, but the problem is the same.
Thank you in advance, and I send you my best regards.
The macro below is used to copy a list created by the user by selecting a variable number of products. This list is in column B of the Recap sheet. Once copied, this list is pasted into the General sheet starting from cell N2.
This macro fails on the paste line, when it reaches: ".Range("N2")....." the macro gives the following message: Error, The PasteSpecial method of the Range class has failed
What troubles me is that if I move the macro's indicator to: " With Worksheets("Recap") " and press F5, the macro runs without any problems.
So, who can help me?
PS: I also tried with: ActiveSheet.Paste, but the problem is the same.
'Reporter With Worksheets("Recap") X = 8 While .Range("B" & X) <> "" X = X + 1 Wend X = X - 1 .Range("B8", "B" & X).Copy With Worksheets("Général") .Activate .Unprotect .Range("N2").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False .Protect End With Sheets("Recap").Activate End With Thank you in advance, and I send you my best regards.