+ Reply to Thread
Results 1 to 8 of 8

Copy Data from multiple sheets to Main datasheet

  1. #1
    Registered User
    Join Date
    05-13-2013
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2003
    Posts
    4

    Copy Data from multiple sheets to Main datasheet

    Hi, I am new to the forum and this is my first posting. I have only created a few simple (very simple) VBA codes in the past.

    I have a workbook that contains multiple sheets, currently five sheets of which only two of them are Info Datasheets.

    I would like to create a VBA code that pulls data from multiple info datasheets and compiles that data into one Main Database sheet. However, after that initial collection, I need the code to maintain the rows data. Specifically, if any row’s data changes in the info Datasheets I need that row on the main Database sheet to update.

    The columns in the info datasheets range from A:AH, however I only need the columns A:E to be copied. And I would like the code to add column F in the main datasheet displaying the sheet name were the data was retrieved

    Each Info sheet (Metals, Polymers) are setup identical;
    Rows 1:3 are the headers, and Column D and/or Column E will denote a change to the row.

    The Main Database sheet (Table of Context) has 2 rows for the header. So, the data will start on row 3

    F-S886 (Material Properties Database)_DRAFT_5.xls

    Any help would be greatly appreciated,
    Thank you
    Dave

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Copy Data from multiple sheets to Main datasheet

    Hi Bogleda,

    Here's one to load your Table of Context:

    Please Login or Register  to view this content.
    I'm thinking about the change event code now

    Here's a start! F-S886 (Material Properties Database).xls

    And - Welcome to the forum
    Last edited by xladept; 05-06-2014 at 05:51 PM.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    05-13-2013
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Copy Data from multiple sheets to Main datasheet

    Hello, xladept.

    Thank you. The copy code worked perfectly.

    The change code you are working on, will it also update the table
    of context when new data is entered into the info sheets? I have
    many more materials to add.

    Again, Thank you for your help.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Copy Data from multiple sheets to Main datasheet

    Hi Bogleda,

    The change code is included in the attachment - will the A column entry ever be changed?

    You're welcome and thanks for the rep!

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Copy Data from multiple sheets to Main datasheet

    Hi Bogleda,

    Just in case you want to change the Number:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    05-13-2013
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Copy Data from multiple sheets to Main datasheet

    Hi, xladept.

    No, the number will never change. The number is the controlling body for that specific material type. Once the Row is added to the Info datasheet, it will never be deleted.

    I notice the columns are now numbered. Could they be changed back to letters?
    If not, no big deal. I can update my supporting SOPs accordingly.

    I will need to add to the materials list on the info datasheets. However, I just added a few more on the metals sheet, but the new items did not show up on the table of context sheet. I tried re-running the copy code; this just adds the entire metals sheet data to the bottom of what was already on the Table of Context sheet.

    Also, I will most likely need, in the future, to add new Sheets for Isotropic-Hyperelastic, Isotropic-Elastoplastic, Orthotropic, and Transversely-Isotropic materials.

    To sum up:
    Can I add line items (Rows) to the existing info datasheets that will copy over to the TOC?
    Can the conditional formatting be copied with the data to the TOC?
    Can I add info datasheets to the workbook and would they be included with the copy code?


    Ps. do you have any recommendations on books that will help me understand VBA code and how to develop VBA codes?
    a.k.a VBA Code for dummies


    Thank you, again for all your help.
    Dave

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Copy Data from multiple sheets to Main datasheet

    Hi Bogleda,

    Can I add line items (Rows) to the existing info datasheets that will copy over to the TOC?

    Can I add info datasheets to the workbook and would they be included with the copy code?
    You'd have to disable events and rerun the :Bogleda for that

    Can the conditional formatting be copied with the data to the TOC?
    The program would have to be rewritten to transfer the Conditional Formatting

    I used "Writing Excel Macros" - O'Reilly by Steven Roman
    and I bought "Excel 2003 Power Programming with VBA" by John Walkenbach.

    But we have a Tips and Tutorials Forum with many good suggestions
    Last edited by xladept; 05-08-2014 at 03:52 PM.

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Copy Data from multiple sheets to Main datasheet

    Hi Bogleda,

    This should get your CF:

    Please Login or Register  to view this content.
    And - when you're building the full book, you could just Change the name of the event code in the ThisWorkbook module:

    Please Login or Register  to view this content.
    Last edited by xladept; 05-09-2014 at 02:43 PM.

+ 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. Copy data from multiple sheets to one main based on cell value
    By jdjenterprises in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-28-2013, 10:13 PM
  2. Replies: 2
    Last Post: 02-06-2013, 11:25 AM
  3. [SOLVED] Macro to get/copy data from multiple secondary sheets to main sheet
    By CaatalyyN616 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-29-2012, 04:22 AM
  4. copy data from main sheet to respective sub sheets
    By sshanku1985 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 03-14-2011, 12:26 PM
  5. Copy Varying Range Sizes from Multiple Sheets to Main Sheet
    By Wester in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-30-2010, 03:12 PM

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