+ Reply to Thread
Results 1 to 9 of 9

Copy Data to a new workbook

  1. #1
    Registered User
    Join Date
    05-10-2017
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    23

    Exclamation Copy Data to a new workbook

    Hello,

    I'm using the code to copy data from a sheet to another and at the same time copy it to a new workbook however it's not working always an error. Please advice, than you in advanced.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Copy Data to a new workbook

    Where is the error (which line is highlighted), what does the error message say and explain what you want to do.

  3. #3
    Registered User
    Join Date
    05-10-2017
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    23

    Re: Copy Data to a new workbook

    The line highlighted is "MYDATA.Save"
    Compile error: Method or data member not found

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Copy Data to a new workbook

    You are assigning the variable to Workbook Collection.
    Try get rid of "s".
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-10-2017
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    23

    Re: Copy Data to a new workbook

    Didn't solve the problem

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Copy Data to a new workbook

    Does it actually paste in DATABOOK2? You don't open it anywhere that I can see.
    Maybe this line
    Please Login or Register  to view this content.
    should be
    Please Login or Register  to view this content.
    Is this the line you have in your code?
    Please Login or Register  to view this content.
    Do you have a "USER" in C:\Users? Or is it your name?

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Copy Data to a new workbook

    Quote Originally Posted by webiscore View Post
    Didn't solve the problem
    This doesn't help at all.

    How is it not working? what are you trying to do? What error in which line?

  8. #8
    Registered User
    Join Date
    05-10-2017
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    23

    Re: Copy Data to a new workbook

    I've modified the code now thanks to @jolivanes I added the Open tag however the error highlighted now
    "Range("A5:K4005").PasteSpecial"

    It's not pasting in this range, actually it should be from A5-A4005 to K5-K4005.

  9. #9
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Copy Data to a new workbook

    Did you see what the excel vba help says about pastespecial?

+ 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. Replies: 12
    Last Post: 07-29-2014, 01:06 PM
  2. [SOLVED] Macro to find data in source workbook and copy paste to target workbook
    By D.Lovell in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-23-2014, 06:21 AM
  3. Copy data one workbook to another workbook without opening workbook
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-04-2014, 11:28 AM
  4. Replies: 6
    Last Post: 01-29-2013, 07:01 AM
  5. Copy data from workbook, create new workbook, paste data to new worbook?
    By mpkavanagh in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-16-2011, 06:39 PM
  6. 1.Open workbook. 2 copy data. 3 replace data. 4 save workbook.
    By Cristobalitotom in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-05-2006, 07:24 PM
  7. Replies: 1
    Last Post: 04-01-2006, 03:50 PM

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