Close

Results 1 to 20 of 26

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    DF VIP Member Soulassassin's Avatar
    Join Date
    Jan 2002
    Location
    Newcastle UK
    Posts
    2,747
    Thanks
    271
    Thanked:        342
    Karma Level
    459

    Default Re: Excel help, copying data to another workbook.

    Quote Originally Posted by Mystical_2K View Post
    Here is a basic example mate,

    Haven't had time to do you a more in-depth one but it does copy a range of values from the source workbook into a destination workbook and I have kept the code really straight forward (i hope!)

    I have also attached a working example (well it worked for me but this is excel)

    Extract the folder to "c:\"

    source file will be: C:\excel\source.xlsm
    destination file will be C:\excel\destination.xlsx

    Code:
    Sub Copy()
        Dim InputFile As Workbook
        Dim OutputFile As Workbook
        
        Set InputFile = ActiveWorkbook
        Set OutputFile = Workbooks.Open("c:\excel\destination.xlsx")
    
        'Now, copy what you want from InputFile:
        InputFile.Sheets("Sheet1").Activate
        InputFile.Sheets("Sheet1").Range("A1:B10").Copy
    
        OutputFile.Sheets("Sheet1").Activate
        OutputFile.Sheets("Sheet1").Range("A1").PasteSpecial
        OutputFile.Close savechanges:=True
    End Sub
    happy to help more but would have to be later in the week

    excel.rar
    Thank you for your time, if I'm correct does this copy range A1 to B10 from the source and pastes it to A1 in the destination?
    However what I am after is copying the end row of a list (constantly being added to) from B to F and pasting it in another document into the end row of that likely longer list (i.e not the same row)

  2. #2
    DF VIP Member
    Mystical_2K's Avatar
    Join Date
    Jun 2002
    Location
    Sunnyvale
    Posts
    4,660
    Thanks
    1,192
    Thanked:        978
    Karma Level
    673

    Default Re: Excel help, copying data to another workbook.

    Quote Originally Posted by Soulassassin View Post
    Thank you for your time, if I'm correct does this copy range A1 to B10 from the source and pastes it to A1 in the destination?
    However what I am after is copying the end row of a list (constantly being added to) from B to F and pasting it in another document into the end row of that likely longer list (i.e not the same row)
    Yes mate, thats what it does, I will take another look and see what I can put together
    You know he grew up as a little shitspark from the old shitflint and then he turned into a shitbonfire and driven by the winds of his monumental ignorance he turned into a raging shitfirestorm. If I get to be married to Barb I'll have total control of Sunnyvale and then I can unleash the shitnami tidal wave that will engulf Ricky and extinguish his shitflames forever. And with any luck he'll drown in the undershit of that wave. Shitwaves.

    Thanks to Mystical_2K

    Soulassassin (23rd May 2017)  


Similar Threads

  1. Replies: 0
    Last Post: 23rd July 2012, 06:50 PM
  2. Replies: 14
    Last Post: 15th April 2012, 02:46 AM
  3. copying data from 20gb to 60gb
    By eblaster101 in forum Microsoft Consoles
    Replies: 2
    Last Post: 18th December 2008, 07:28 PM
  4. Data matching in excel..
    By daz73 in forum PC Software
    Replies: 2
    Last Post: 19th August 2005, 08:57 PM
  5. The Official MUFC Maths Workbook
    By kanu690 in forum Football
    Replies: 5
    Last Post: 4th January 2003, 06:04 PM

Social Networking 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
  •