Hello, I am trying to create a macro in my Personal.xlsb that will
1. Clear all data in worksheet except row 1 (done)
2. Select a cell where new data will be pasted (done)
3. Paste data from Clipboard via PasteSpecial Paste:=xlPasteValues (failed)
Before I run the macro I have copied in the clipboard data from another program, when I run the macro it does everything except pasting, I get the following error:
Run-time error '1004' - PasteSpecial method of Range class failed
Sub DeleteAndPaste()
Rows(1).Offset(1, 0).Resize(Rows.Count - 1).ClearContents
Range("A2").Select
'Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
I checked and there is data in the clipboard, and I confirmed this by doing a manual paste special into the cell after the macro failed and it works, but not from the macro. Any help is greatly appreciated.
Bookmarks