I am getting a macro error in Excel and would like to know if anyone can help me with the coding. The code is below. The error occurs on the last line of code
(Selection.PasteSpecial Paste:=xlDataValidation, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False)
and gives me the following error:
Run-time error '1004'
PasteSpecial method of Range class failed
Sub test()
'
' test Macro
' Macro recorded 9/16/2008 by Computer User
'
'
Application.Goto Reference:="R20C12"
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=INDIRECT($H$5)"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = "Error"
.InputMessage = ""
.ErrorMessage = "You must enter a valid general ledger account number"
.ShowInput = True
.ShowError = True
End With
Selection.Copy
Range("L21:L484").Select
Selection.PasteSpecial Paste:=xlDataValidation, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub
Thanks in advance for any help
Bookmarks