+ Reply to Thread
Results 1 to 4 of 4

Pasting into another workbook

  1. #1
    Registered User
    Join Date
    06-19-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    98

    Pasting into another workbook

    Hey Guys,

    I'm trying to write a macro that copies values from one sheet and pastes them into Sheet1 in a different workbook.

    I have the code below, but it errors out at the pasting step ( Range("A1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone )

    The error is:

    "Run-time error '1004';

    PasteSpecial method of Range Class failed"

    Anyone have any idea what's going on?

    Thanks!

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Pasting into another workbook

    The Problem is that you used clearcontents method before pastespecial method..
    The possible correction would be....

    Please Login or Register  to view this content.
    Last edited by Vikas_Gautam; 10-22-2014 at 12:02 AM.
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

  3. #3
    Registered User
    Join Date
    06-19-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    98

    Re: Pasting into another workbook

    hmm now I'm getting,

    "Run-time error '9':

    Subscript out of range"

    With debugging telling me that error is at,

    Please Login or Register  to view this content.

  4. #4
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Pasting into another workbook

    Try this then..
    Or Upload both files to work upon...

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. macro to find matching value in workbook and pasting it to another workbook
    By aman2059 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-19-2014, 03:41 PM
  2. [SOLVED] Opening new workbook and pasting values into current workbook - code issues
    By Stew1234 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-15-2014, 07:56 AM
  3. Filtering in another workbook, copying filtered data and pasting in source workbook
    By saadtariq in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-13-2012, 12:55 PM
  4. [SOLVED] Macro Wanted for looping thru worksheets in one workbook and pasting to another workbook!!
    By eduardito in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 07-03-2012, 07:43 AM
  5. Replies: 0
    Last Post: 08-11-2011, 01:23 AM

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