+ Reply to Thread
Results 1 to 3 of 3

VBA keeps giving errors on PasteSpecial

  1. #1
    Registered User
    Join Date
    04-11-2012
    Location
    Melbourne Australia
    MS-Off Ver
    Excel 2010
    Posts
    1

    VBA keeps giving errors on PasteSpecial

    Hello

    I keep getting an error when the script gets to PasteSpecial and I have no idea why.

    The script is included here.

    Please Login or Register  to view this content.
    Any suggestions of a constructive nature will be warmly received.

    Thanking you in advance.
    Last edited by Inter; 04-12-2012 at 02:51 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: VB Script keeps giving errors on PasteSpecial

    PasteSpecial takes a number of arguments. You don't have any. I think the correct syntax is "selection.pastespecial" too, not sheets(2).pastespecial. Turn on the macro recorder, copy and paste something using the paste special you want to use, and then check the code.

    Also, you shouldn't call VBA VB Script - that is something different.

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: VB Script keeps giving errors on PasteSpecial

    This post deleted by Ben
    Last edited by protonLeah; 04-12-2012 at 11:03 PM.
    Ben Van Johnson

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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