+ Reply to Thread
Results 1 to 7 of 7

Help pasting Range from one workbook to another

  1. #1
    Registered User
    Join Date
    01-16-2013
    Location
    Baltimore, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    4

    Help pasting Range from one workbook to another

    Hello all, I'm fairly new to VBA and I can't seem to get my code to work.

    Please Login or Register  to view this content.
    The Error occurs at "wb2.Range("L2:L1000").PasteSpecial Paste:=xlPasteValues" in red. I'm not sure how efficient my code is, so any help would be greatly appreciated. I'm trying to take this one step at a time, but my next step will be to copy only the cells with content using:

    Please Login or Register  to view this content.
    and paste those.



    Moderator's Note: Welcome to the forum. In posting codes the codes should be enclosed with code tags. Select the coe then hit the "#" sign. I'll do it for now. Thank you.
    Last edited by vlady; 01-16-2013 at 10:06 PM. Reason: code tags

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Help pasting Range from one workbook to another

    You need a worksheet reference here.
    Please Login or Register  to view this content.
    For example if you were pasting to 'Sheet2' in wb2.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    01-16-2013
    Location
    Baltimore, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Help pasting Range from one workbook to another

    Thanks for the help, It didn't work though, I still get the error message "Object does not support this property or method"

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Help pasting Range from one workbook to another

    Can you post the exact code you have now?

    Did you change 'Sheet2' to the name of the actual worksheet you want to paste to in the 2nd workbook?

  5. #5
    Registered User
    Join Date
    01-16-2013
    Location
    Baltimore, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Help pasting Range from one workbook to another

    Yes, the sheet in my second workbook is Sheet1

    Please Login or Register  to view this content.
    I have these two assigned to two different form buttons. It's meant to bring in info from one workbook, allow the user to run several calcs and adjust a few variables, then export the final product to (one column) to the new spreadsheet.

    Thanks for the help

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Help pasting Range from one workbook to another

    Is this the line you get the error on?
    Please Login or Register  to view this content.
    If it is it might be something to do with a missing 'S'.

  7. #7
    Registered User
    Join Date
    01-16-2013
    Location
    Baltimore, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Help pasting Range from one workbook to another

    Wow. Well.... I feel like an idiot now haha.... Thanks a lot though

+ 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