+ Reply to Thread
Results 1 to 9 of 9

VBA to Autofill cells from Multiple Combo Box Selections & Add below last entry in list

  1. #1
    Registered User
    Join Date
    10-29-2011
    Location
    England
    MS-Off Ver
    Excel 2000
    Posts
    12

    VBA to Autofill cells from Multiple Combo Box Selections & Add below last entry in list

    Hi All

    Please find attached workbook with format layout and sample data. We have 3 identical turbines that require us to lock out certain switches valves when working on the equipment. The only diffrence in the location / name of the switch or valve to lockout.

    I would like if possible to have 2 dropdown lists one is to select which turbine the other what part of the system you are working on. depending on the selection the cells A7-A51 on the main worksheet would be filled with data from the Unit selected worksheet. and then if more than one part of the system needs to be locked out the code would see where the last entry is in colum A and add the next selection below this.

    The maximum ammount of locks/tags per system would be 15 but i have only added some sample locks on each units worksheet

    If the list of locks on the main sheet was more than the cells avalible as i have formatted for A4 print could it create an extra page or maybe im getting ahead of myself.

    Any help apreciated also if this seems a bit too much i will purchase 100 points to speed up the process

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA to Autofill cells from Multiple Combo Box Selections & Add below last entry in lis

    Hi medihx

    This Code in the attached appears to do as you require based on the Sample Data. Please note the addition of two Dynamic Named Ranges that populate the Drop Downs.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    10-29-2011
    Location
    England
    MS-Off Ver
    Excel 2000
    Posts
    12

    Re: VBA to Autofill cells from Multiple Combo Box Selections & Add below last entry in lis

    Hey thanks for the quick reply and great code it does work a treat.

    Only problem is if the data goes over row 51 i get an error 1004 cannot change part of a merged cell.

    I thought the problem was in the last bit of code ws1 should it be LR1 not LR but i tried that without success. I then tried to just move the data over to colum F which worked ok but only once the data would not keep adding below just over writing the last entry.

    Thanks again i suppose i could just do 2 sheets if i have over 51 entrys to make. I just wanted to make it as easy and safe as possible for my guys to use They end output will be printed and used to walk around the plant.

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA to Autofill cells from Multiple Combo Box Selections & Add below last entry in lis

    Hi medihx

    What do you wish to happen if there are over 51 rows?

  5. #5
    Registered User
    Join Date
    10-29-2011
    Location
    England
    MS-Off Ver
    Excel 2000
    Posts
    12

    Re: VBA to Autofill cells from Multiple Combo Box Selections & Add below last entry in lis

    Hi John

    I would ultimately like to be able to print at A4. With the Header i have in rows 1-6 at the top of my print, then the footer rows 52-55 at the bottom of the print
    And then the data in the middle maximum of 80 rows total. Can be 2 pages printed of course.

    I was thinking maybe after row 51 the next data added would be placed in F7 and continue adding below that like you have it now. I can then duplicate the header and footer for print purposes.

    Or maybe theres an easy way

    Thanks again

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA to Autofill cells from Multiple Combo Box Selections & Add below last entry in lis

    Hi medihx

    Try the Code in the attached...see if it addresses the Multi Page issue.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-29-2011
    Location
    England
    MS-Off Ver
    Excel 2000
    Posts
    12

    Re: VBA to Autofill cells from Multiple Combo Box Selections & Add below last entry in lis

    Hi John

    Great work with the multi page. I just have one issue.

    Data will only copy over to the second page if it started on the first page. When i try to add data below the last entry on page 2 the Counter in A1 adds up but nothing is shown on page 2.

    I though it was because i had messed about with the layout format, but seems to be the same on the LockoutV1 you originally posted.

    Also i added some code to clear BG colour aswell.

    Thanks
    Attached Files Attached Files

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA to Autofill cells from Multiple Combo Box Selections & Add below last entry in lis

    Hi medihx

    Let me play with the convoluted Logic a bit...

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA to Autofill cells from Multiple Combo Box Selections & Add below last entry in lis

    Hi medihx

    I've revised the Add Button Code...you'll need to tell me
    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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. List Box Selections Outputting Multiple Selections with One Click
    By Mordred in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-21-2011, 12:27 PM
  2. Multiple selections from a pick list - only unique selections (no repeats) ?
    By opsayo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-24-2011, 06:25 PM
  3. Allowing multiple selections on an entry field
    By ValentineNicole in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-21-2010, 12:08 PM
  4. Combo box - multiple selections
    By Sun Li in forum Excel General
    Replies: 1
    Last Post: 06-21-2007, 04:05 AM
  5. Replies: 3
    Last Post: 04-06-2006, 10:45 AM

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