Hey all,
I'm new to VBA but have had it working well for me until the other night when a user complained that when he ran a macro, it came up with the error "Paste method of Worksheet class failed". I should note that this function has worked time and time again, so I'm lost as to why it just started. I also found tonnes of answers with a Google search but they were all relative to that persons code.
So this is the code I am using to paste from the clipboard into another tabbed worksheet (apologies if the code is horrible) - Also the part where the debugger stops (and highlights) is ActiveSheet.Paste
Sub PasteDemand()
'
' PasteDemand Macro
'
'
Sheets("Demand").Visible = True
Sheets("Demand").Select
Application.Volatile (False)
ActiveSheet.Range("A2:X400").Clear
Cells.Select
Application.DisplayAlerts = False
ActiveSheet.Paste
Application.DisplayAlerts = True
Columns("D:D").Select
With Selection
Selection.NumberFormat = "0"
.Value = .Value
End With
Sheets("Demand").Visible = False
Sheets("Cover").Select
Range("C5").Select
End Sub
Thank you for any help!
Bookmarks