+ Reply to Thread
Results 1 to 5 of 5

Hooking Up VBA With Sheet Based Combo Boxes?

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    09-23-2005
    Location
    Bristol, UK
    MS-Off Ver
    2007
    Posts
    664

    Hooking Up VBA With Sheet Based Combo Boxes?

    Hi all,

    I've been asked to create a document with two drop-down menus. The first specifies a column to search, the second a specific date. So, for instance, on one drop down the use might select 'Invitation To Tender Date', and on the second 'October 2008'. Thereafter all dates in the 'Invitation To Tender' column are filtered to October 2008 (why people can't do this manually I don't know!).

    I'd quite like to use Combo Boxes placed directly on the sheet to do this. However, I'm not quite sure how to hook up the VBA to a Combo Box on a sheet.

    My question is: will I need to place the Combo Boxes in a user form to allow them to be 'VBAed', are can I somehow connect them from the sheet. Or if I want to have sheet-based drop downs can this be done with validation drop-downs?

    Hope that makes sense - any advice much appreciated!

    TIA,

    SamuelT

  2. #2
    Registered User
    Join Date
    03-30-2009
    Location
    Derby, England
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Hooking Up VBA With Sheet Based Combo Boxes?

    SamuelT

    You should be able to attach code to a combobox on the sheet, just insert it (set the control toolbox to visible to get the required buttoms), and double click it in design mode to fire up the VBA editor and create code for the 'change' event, for other events there is a combo box towards the top right.

    Good luck

    Mat

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Hooking Up VBA With Sheet Based Combo Boxes?

    You can use either sheet based or a userform. I think for specific help an example workbook would help
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Valued Forum Contributor
    Join Date
    09-23-2005
    Location
    Bristol, UK
    MS-Off Ver
    2007
    Posts
    664

    Re: Hooking Up VBA With Sheet Based Combo Boxes?

    Hi guys,

    Thanks for the advice. See attached document - it's a macro-enabled 2007 doc which I hope won't cause a problem.

    As you'll see, the first box refers to columns H, J and K, whilst the second to the specific dates in each.

    Hope that clears things up.

    SamuelT
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor
    Join Date
    09-23-2005
    Location
    Bristol, UK
    MS-Off Ver
    2007
    Posts
    664

    Re: Hooking Up VBA With Sheet Based Combo Boxes?

    Hi guys,

    I posted this up yesterday as a seperate thread, but have now been advised (cheers RoyUK ) to continue it in this post. So...

    I have two ComboBoxes on a sheet. One ('CatCombo') has three column names in it ('EOI Sub Date', 'ITT Release Date' and 'Tender Sub Date'). The other ('DateCombo') which has months in it. What I'm trying to do is for a user to be able to select a column name from the first ComboBox, and a date from the second. Then, when the user hits a button ('FilterButton'), Excel will filter a specific column (let's say A,B,C) on the date in DateCombo.

    See previously posted example for what the document looks like. Any advice on how to do this would be greatly appreciated.

    TIA,

    SamuelT

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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