+ Reply to Thread
Results 1 to 5 of 5

Default Value in Combobox

  1. #1
    Registered User
    Join Date
    10-05-2007
    Posts
    15

    Default Value in Combobox

    Is there a way to set a default value for a combobox (or ALL comboboxes on a worksheet) so that it is automatically set to that value when the file is opened?

    Thanks for your help.

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

    This macro will set the each Drop Down in the entire workbook to the first item in its list. You can place a call to this macro in either an Auto_Open procedure or the Worksheet_Open event procedure.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    10-05-2007
    Posts
    15
    Hi Leith thanks for your code. However, I can't get it to work. I think its because I'm using Comboboxes and not dropdowns.

    I tried to modify your code some with some you posted earlier. so now it looks like:

    Please Login or Register  to view this content.
    I also tried:

    Please Login or Register  to view this content.
    But I can't get either to work.

    I also tried taking away the wks refefernces (leaving just 'For each obj.. next obj') and using Auto_Open instead of Worksheet_Open but none of that works either.

    Any suggestions?

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

    If you could post your workbook that would be best. At this point, I don't have any ideas what may be the problem.

    Sincerely,
    Leith Ross

  5. #5
    Registered User
    Join Date
    10-05-2007
    Posts
    15
    I think I figured out what part of the problem was. I was placing that code on the worksheet and not in a module.
    I moved the code to a module and it worked (sort of), but it took over an hour for the workbook to load.

    When it did load, the boxes were set to the second item and not the first. I needed to use:

    Please Login or Register  to view this content.
    I decided to move the action call to a commandbutton and it works great. Thanks. Eventually I had to use

    Please Login or Register  to view this content.
    I don't know if I need to open a new thread, but I'd also like to know how to send a different value to a cell based on what is selected in the combobox. Like a vlookup, but from within the box.
    Something like :
    Please Login or Register  to view this content.
    Again this will be a global and apply to every box in the worksheet.

    Any thoughts?
    Here's part of the file. I had to recreate, take some of the more conf. stuff out and I've also turned auto-calculate off to meet the size req.
    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)

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