+ Reply to Thread
Results 1 to 6 of 6

Autopopulating multiple sheets from one main sheet

  1. #1
    Registered User
    Join Date
    11-27-2017
    Location
    London
    MS-Off Ver
    2016
    Posts
    3

    Autopopulating multiple sheets from one main sheet

    Hi,

    I am trying to create a spreadsheet that uses one Master sheet (called Master), and then populates other worksheets with the data from that main sheet. I want to use Column C 'Business Owner' as the data that determines which subsheet that row goes into. So, if I enter 'David' into Column C, I want all data from that row on the Master sheet to copy into the worksheet called 'David', and same for 'Veronica', 'Celeste' etc. This is a working document that will be updated by multiple users, so if any updates are made to the rows at any time, I want all of those updates to copy across to the corresponding subsheet whenever they are made. I'm currently using the below code, which works to some degree; it copies the row to the correct sheet when I enter a value in row C, but if I update the row in any other column, the updates don't copy across. Also, if I re-confirm the name in Column C, it adds a duplicate line in David's worksheet, rather than overwrite the changes.

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Columns("C:C")) Is Nothing Then Exit Sub

    If Target.Value = "David" Then
    Range(Range("A" & Target.Row), Range("AU" & Target.Row)).Copy _
    Sheets("David").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)

    I'm very new to Macros so any help would be much appreciated!

    Many thanks,

    Hayley
    Last edited by HayleyN; 11-27-2017 at 09:29 AM.

  2. #2
    Forum Contributor
    Join Date
    01-09-2016
    Location
    Perth Western Australia
    MS-Off Ver
    Office 365
    Posts
    257

    Re: Autopopulating multiple sheets from one main sheet

    Hi

    Is it possible to upload a sample spreadsheet because my first thoughts are to use a formula to attain your desired result?

    Cheers

  3. #3
    Registered User
    Join Date
    11-27-2017
    Location
    London
    MS-Off Ver
    2016
    Posts
    3

    Re: Autopopulating multiple sheets from one main sheet

    Thanks for replying so quickly! Here's a streamlined version of the spreadsheet. At the moment, if I enter a name into Column B on the Master sheet (say David) the entire row will copy to David's sub sheet. However, if I then update the delivery date or any data in any other column, those updates don't copy across to David's sub sheet. Any help much appreciated!
    Attached Files Attached Files

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: Autopopulating multiple sheets from one main sheet

    I've attached an example showing how you can achieve this using three formulae, rather than a macro.

    In the Master sheet I have this formula in cell I3:

    =IF(B3="","-",B3&"_"&COUNTIF(B$3:B3,B3))

    which can be copied down as far as you need to (I've copied all formulae to row 10 in the example, as well as colouring them blue). This will set up a unique number for each record as it is copied down (you will see that I've added some more data to your file to help illustrate this).

    Then in each of the subsidiary sheets I have put the name of the sheet in cell I1 and this formula in I2:

    =IFERROR(MATCH($I$1&"_"&ROWS($1:1),Master!I:I,0),"")

    This tells you where in the Master sheet there is a matching record (for David_1, David_2 etc. as it is copied down). Then in cell A2 I have this formula:

    =IF($I2="","",INDEX(Master!A:A,$I2))

    and this retrieves the appropriate data from column A of the Master sheet. When it is copied across into B2:H2 it will bring the data from those columns of the Master sheet, for the row identified in I2. Then the formulae in A2:I2 can be copied down as far as you need them.

    As this is a formula-based solution, then if you change any of the data in the Master sheet it will be reflected in the subsidiary sheet automatically.

    Hope this helps.

    Pete
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-27-2017
    Location
    London
    MS-Off Ver
    2016
    Posts
    3

    Re: Autopopulating multiple sheets from one main sheet

    Pete, thank you so much, that's exactly what I needed! It works perfectly. Really appreciate your help. H

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: Autopopulating multiple sheets from one main sheet

    Glad to hear it, Hayley - thanks for feeding back.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post and mark this thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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: 9
    Last Post: 11-06-2017, 09:27 AM
  2. Autopopulating multiple sheets in a workbook from one master sheet
    By aheffron in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-07-2017, 07:15 PM
  3. Replies: 2
    Last Post: 07-25-2016, 09:35 AM
  4. Matching Multiple sheets data to a main sheet
    By Ryan29 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 07-05-2016, 10:21 AM
  5. Populate data from one main sheet to multiple sheets
    By robi0342 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-23-2016, 10:16 PM
  6. Populate data from one main sheet to multiple sheets
    By robi0342 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-23-2016, 09:19 PM
  7. Populate data from one main sheet to multiple sheets
    By dfulmer in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 12-31-2012, 05:24 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