WallisAggie646777
New Member
- Joined
- May 6, 2020
- Messages
- 8
- Office Version
- 365
- Platform
- Windows
I did a record macro to copy a range of cells from one worksheet and paste into another worksheet which worked when recording the macro with my keystrokes.
When I put the code generated from the run macro into my code and try to execute it, and get the Select method of Range class failed error message. The code that fails is shown below.
There are no merged cells.
Sheets("Groups").Select
Range("O7:T32").Select 'THE ERROR OCCURS ON THIS LINE OF CODE
Application.CutCopyMode = False
Selection.Copy
Sheets("Temp").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
When I put the code generated from the run macro into my code and try to execute it, and get the Select method of Range class failed error message. The code that fails is shown below.
There are no merged cells.
Sheets("Groups").Select
Range("O7:T32").Select 'THE ERROR OCCURS ON THIS LINE OF CODE
Application.CutCopyMode = False
Selection.Copy
Sheets("Temp").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy