+ Reply to Thread
Results 1 to 13 of 13

Autofill 3 columns by matching master spreadsheet and another sheet

  1. #1
    Registered User
    Join Date
    09-14-2017
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2013
    Posts
    5

    Autofill 3 columns by matching master spreadsheet and another sheet

    Hello,
    I have two spreadsheets within my workbook: a MasterList spreadsheet and a WeeklySchedule spreadsheet. I am trying to create a macro that looks up the first column in the WeeklySchedule and MasterList spreadsheet and auto-populates the other columns based on the MasterList.

    In addition, I want to lookup a column within the MasterList. If the column matches with the previous row in the WeeklySchedules, return a NO. If it doesn't match, return YES.

    The MasterList looks something like this:

    Part ............... RawMaterial .............Diameter.........SetupHours
    12345..............65432.....................0.75..................2
    54321............. 98765.....................1.......................3
    11223..............23456......................0.5 ..................4
    33221............. 78910.....................0.75 .................5
    .

    The WeeklySchedule looks something like this:

    Part ........RawMaterial............ Diameter........SetupHours........DiameterChange
    12345
    33221
    11223


    I want a macro that looks up the Part on the MasterList and auto-populates the RawMaterial, Diameter, and SetupHours columns based on that Part #.
    Then, I want to compare the Diameters. If the previous row is the same Diameter, then return a NO. If the Diameter is different, then return a YES in the DiameterChange column. So, in this example, Part 33221 would have a YES in the DiameterChange column since part 12345 has the same Diameter.

    Thank you so much for anyone willing to help me.
    Last edited by newtoexcelmacro; 09-15-2017 at 11:46 AM.

  2. #2
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Autofill 3 columns by matching master spreadsheet and another sheet

    can you upload a sample workbook?

    yes that can be done.

  3. #3
    Registered User
    Join Date
    09-14-2017
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Autofill 3 columns by matching master spreadsheet and another sheet

    Hello,

    I believe I have uploaded the sample spreadsheet.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Autofill 3 columns by matching master spreadsheet and another sheet

    ok, please review your file and see if it meets your needs:
    Attached Files Attached Files
    Last edited by dmcgov; 09-14-2017 at 11:11 AM.

  5. #5
    Registered User
    Join Date
    09-14-2017
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Autofill 3 columns by matching master spreadsheet and another sheet

    Hello dmcgov,

    Thank you. This performs exactly how I want, however, I would prefer it to be in the form of a macro rather than cell functions. Do you have ideas on how to take this logic and create a macro to do the exact same thing?

  6. #6
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Autofill 3 columns by matching master spreadsheet and another sheet

    so you want a macro to do what? add a new row to weekly schedule and then fill out the columns? or add to your masterlist?

    i don't understand why you want the macro as all you have to do is copy the formulas down in columns B,C,D,E. A is just a validated lookup from the masterlist. that way there is no coding to trip up the end user.

  7. #7
    Registered User
    Join Date
    09-14-2017
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Autofill 3 columns by matching master spreadsheet and another sheet

    I don't want the user to have any formulas to potentially affect at all. That's why I want a macro running in the background.

    I want to do exactly what your spreadsheet does except I want a macro running in the background rather than formulas on the spreadsheet itself.

  8. #8
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Autofill 3 columns by matching master spreadsheet and another sheet

    ok, i have something in mind that i did a couple of weeks ago that might fit the bill. give me some time to come up with a solution.

  9. #9
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Autofill 3 columns by matching master spreadsheet and another sheet

    ok, so here it is, please test sample2.xlsm to see if it does what you require

    Note that i named the sheets("MasterList").Range("A2:D8") to .Range("MasterListParts"), also notice the blank row at the bottom of the named range. that is so you can insert rows into the range.

    I put the validation list in column a to row 1000, just extend that if you need to go beyond that row.

    also, clear the contents of weekly schedule (but preserve the label on row 1)
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Autofill 3 columns by matching master spreadsheet and another sheet

    so i managed to modify the vlookup to put the value of the lookup in the cell vs it being a formula.

    review the spreadsheet below and see if that works better for you.

    if you need column e to be a value (string) instead of a formula, i have that fixed as well.
    Attached Files Attached Files
    Last edited by dmcgov; 09-15-2017 at 08:49 AM.

  11. #11
    Registered User
    Join Date
    09-14-2017
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Autofill 3 columns by matching master spreadsheet and another sheet

    Thank you. This helps me so much.

  12. #12
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Autofill 3 columns by matching master spreadsheet and another sheet

    if this fixed your issue, go to near the top of the post and click Thread Tools and Mark as Solved. Then (if i helped you) click on the Add Reputation in my post. I appreciate that.

  13. #13
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Autofill 3 columns by matching master spreadsheet and another sheet

    i was able to put data validation in column "a" just by selecting a cell, if you want that functionality, let me know.

+ 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. Autofill master list (sheet) from multiple sheets
    By Jandeezi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-28-2016, 02:19 PM
  2. Autofill data from 2 sheets to master sheet in a workbook
    By remlap511 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-03-2013, 02:04 PM
  3. [SOLVED] Help!!! Trying to combine three columns from each spreadsheet into one master
    By dangerme in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-29-2012, 04:49 AM
  4. [SOLVED] Return comment to master sheet after matching to source sheet name and cell number
    By jeffreybrown in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-21-2012, 05:09 PM
  5. read cell value on master, copy to matching sheet.
    By ABBOV in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-10-2011, 06:50 AM
  6. Autofill Master sheet
    By toria in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-06-2011, 03:52 AM
  7. Autofill a master spreadsheet with monthly data
    By GatorFanDan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-20-2009, 05:43 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