+ Reply to Thread
Results 1 to 3 of 3

Macro to copy from one worksheet to another in different workbook

Hybrid View

Althas Macro to copy from one... 07-23-2012, 11:20 AM
GaidenFocus Re: Macro to copy from one... 07-23-2012, 12:17 PM
Althas Re: Macro to copy from one... 07-24-2012, 02:42 AM
  1. #1
    Registered User
    Join Date
    09-25-2006
    Location
    North West, UK
    MS-Off Ver
    2010
    Posts
    75

    Macro to copy from one worksheet to another in different workbook

    Hello all

    A friend has asked me to help on this, I am no good at VBA so wonder if anyone can assist

    My friend has multiple workbooks, each containing data. Each worksheet with have the same number of columns but a variable number of rows

    Thinking through, what I deduced the simplest thing to do would be this:
    Have a macro that would
    1.Highlight all the data except the title row in the active workbook
    2.Switch to a different workbook called "Consolidation"
    3.On the next free row, paste the information

    They can then just activate another workbook and run the macro again

    Thanks in advance

  2. #2
    Forum Contributor
    Join Date
    10-08-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    386

    Re: Macro to copy from one worksheet to another in different workbook

    Here are a few macros that will help you

    This code will activate the specified workbook, but it assumes it is already open.
    Windows("Consolidation.xls").Activate
    This code can open workbooks
    Workbooks.Open "C:\INVReport\inventory.xls"
    This code will select the last contiguous record in a column, then select the one right below it (next empty row)
    Selection.End(xlDown).Select
    selection.offset(1,0).select
    As far as running the macro from a different workbook, thats not going to work. Tell me more about the files you are working with, are the names consistent?

  3. #3
    Registered User
    Join Date
    09-25-2006
    Location
    North West, UK
    MS-Off Ver
    2010
    Posts
    75

    Re: Macro to copy from one worksheet to another in different workbook

    Hi Gaiden and thank you

    Unfortunatly the workbooks will have different names, and those names will change

    That is why I was thinking of a macro that would copy all the data from the active worksheet, switch to the "consolidated" workbook, then paste the information starting at the next free line

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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