Results 1 to 2 of 2

Paste Special Method Error

Threaded View

  1. #1
    Registered User
    Join Date
    03-05-2007
    Posts
    3

    Paste Special Method Error

    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
    Last edited by VBA Noob; 09-16-2008 at 03:17 PM. Reason: Change Title

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1