+ Reply to Thread
Results 1 to 15 of 15

how to make multiple Combo boxes feed off one change handler.

  1. #1
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    how to make multiple Combo boxes feed off one change handler.

    Hi. Newbi here. I have 6 combo boxes that each have a change handler that is a request for ID # to choose operator. how can I tighten this code up to feed off on handler?

    Picking log-Rev6.xlsm

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: how to make multiple Combo boxes feed off one change handler.

    Hi there,

    Well I think it's true to say that your code could be made a LOT simpler!

    I'm taking a look at it and I hope to be able to post something here in a day or two.

    A question: Events seem to be disabled (and seldom re-enabled) in many places throughout the application, even by the Workbook_BeforeClose routine - is this intentional?

    Regards,

    Greg M

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: how to make multiple Combo boxes feed off one change handler.

    Hello superchew,

    You don't need the to use the 6 combo boxes and the worksheet event handler. A better approach is to use a VBA User Form. This can be called by each button.

    Entry validation can be accomplished using a single macro. Using the active cell and the cell position of the command button, entries can be validated for the name, start, and stop times having been entered, and if the active cell is in a valid entry zone. By fully validating entries, you prevent errors and "buddy punching".

    Once the entry is validated, the user form is displayed requesting the name and password. The names and passwords are checked against a list on another worksheet. This worksheet is "very hidden" which prevents the users from being able to unhide it from the ribbon. A list makes it easy to edit the names and passwords. Hard coding them into a routine is okay if you are masochist.

    The attached workbook does all this. However, the workbook events have been modified and you will need to uncomment code in them. I did this to eliminate problems running the workbook on my machine. Have look and let me know what you think.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: how to make multiple Combo boxes feed off one change handler.

    I am lost. it looks like you got rid of my combo boxes making it impossible for an EE to log in.

  5. #5
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: how to make multiple Combo boxes feed off one change handler.

    I believe it is intentional, but I am a newbie and have had alot of great people on here helping me out.

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: how to make multiple Combo boxes feed off one change handler.

    Hello superchew,

    All the employee needs to do is click a cell in the "Init" column and click "Start". The login form will be displayed. When finished, click "Stop". Does not get easier than that.

  7. #7
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: how to make multiple Combo boxes feed off one change handler.

    Ok Leith I see where you were going with this and like it. only issue is EE should only have to enter password when first logging into line. and secondaly job requires frequent start stop times, and you code does not seem to allow for this. Also multiple people might work on one line through out the batch.

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: how to make multiple Combo boxes feed off one change handler.

    Hello superchew,

    I can change it. Can you give a couple of examples?

  9. #9
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: how to make multiple Combo boxes feed off one change handler.

    Hi again,

    Take a look at the attached workbook and see if it does what you need.

    One point - the passwords associated with the various employees have been moved to a hidden column (B) on the "Calculations" worksheet. The column can be displayed/hidden by using the "Show/Hide Passwords" button - you will be prompted for a password - the password to enter is the same as the one which you're currently using to protect the "Picking Log" worksheet.

    I think you will find it a lot easier to synchronise passwords with employee names by using this approach.

    Just for information, your original workbook contained 1,211 lines of code - the current version contains 463

    Hope this helps - please let me know how you get on with it.

    Regards,

    Greg M



    P.S. Each "Start" button is disabled until a name is selected in its associated combobox.
    Attached Files Attached Files
    Last edited by Greg M; 12-20-2013 at 03:08 PM. Reason: P.S. re "Start" button added

  10. #10
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: how to make multiple Combo boxes feed off one change handler.

    Greg so far this works awesome. i am just getting into it. One question how do i add names and passwords in the future

  11. #11
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: how to make multiple Combo boxes feed off one change handler.

    Hi again,

    Glad to hear that so far it's working well for you

    As regards adding new names and passwords:

    On the "Calculations" worksheet there's a Named Range ("tblEmployees") which refers to the cells A1:A90 - this contains the names of all the employees and is used to populate the dropdown lists of the various comboboxes. New names can be entered anywhere within this range.

    Column B on this worksheet contains the passwords associated with each employee name and is normally hidden. To add a password for a new name, click on the "Show/Hide Passwords" button (cells C1:D2). This will display a dialog box into which you should enter the password which you are currently using to protect the "Picking Log" worksheet. After clicking on the "OK" button on the dialog box, column B will be displayed. Enter the password for the new employee name in the column B cell beside the employee name.

    When all new passwords have been entered, click on the "Show/Hide Passwords" button - no password is required when column B is being hidden.

    The previous version of the workbook linked the dropdown lists of the various comboboxes to the range A1:A75 on the "Calculations" worksheet - the attached version links the dropdown lists to the "tblEmployees" Named Range - i.e. A1:A90

    Hope the above helps - please let me know how you get on with it.

    Regards,

    Greg M
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: how to make multiple Combo boxes feed off one change handler.

    Many Many thanks for you help. this code looks and works so well appreciate everything.

  13. #13
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: how to make multiple Combo boxes feed off one change handler.

    Hi again,

    You're very welcome. Thanks for your feedback - I'm very pleased that I was able to help.

    Best regards,

    Greg M

  14. #14
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: how to make multiple Combo boxes feed off one change handler.

    question... this works great on my PC, but when I open it on the PC that is will be used on, after entering techs name when i hit start button it saids password supplied in incorrect. check caps (which are not on) and insure proper password. Not sure whats happening. also where is the password located so if I want to change it.

  15. #15
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: how to make multiple Combo boxes feed off one change handler.

    not sure if this helps but the computes in the work space is using excel 2007

+ 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. I need a code for presence check to check multiple text boxes and combo boxes
    By Lee_wwfc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-24-2013, 01:53 PM
  2. Attempting to make tab-able combo boxes or predictive data validation cells.
    By ExcelNewbie2 in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 09-20-2011, 11:05 AM
  3. Multiple Combo Boxes
    By whatsmyname in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-25-2009, 04:05 PM
  4. Make text cells and combo boxes required?
    By mlroy@savvis in forum Excel General
    Replies: 2
    Last Post: 07-24-2006, 03:25 PM
  5. change events for combo boxes
    By brazierpt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-14-2005, 05:29 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