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 has worked time and time again, so I'm lost. 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)
Sub PasteDemand()
'
' PasteDemand Macro
'
'
Sheets("Demand").Visible = True
Sheets("Demand").Select
Application.Volatile (False)
ActiveSheet.Range("A1: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
Bookmarks