+ Reply to Thread
Results 1 to 4 of 4

Load items in combobox

  1. #1
    Registered User
    Join Date
    01-13-2008
    Posts
    19

    Load items in combobox

    Hi,

    Im very new to excel vba. I have created a combobox from the control toolbox and have tried to populate it using the following code:

    Please Login or Register  to view this content.
    which resides in the a worksheet object. The problem is that whenever i open the workbook, the items are no longer filled in the combobox.

    Can anyone point out what im doing wrong? Thanks in advance!

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    It looks like you have tried to put a workbook_open event into the worksheet module.

    Right click on the sheet tab and choose View code.

    In the VB Editor select Worksheet from the left drop down.

    In the right drop down find Worksheet_Activate

    Paste your code there

    Please Login or Register  to view this content.
    Last edited by royUK; 01-13-2008 at 10:52 AM.
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    01-13-2008
    Posts
    19
    Thanks for the response.

    I have tried that and it still does not work as desired.

    What happens is that when i open the workbook, all the items are not filled in the combobox. However, only if i go to another worksheet and then back to the worksheet with the combobox will all the items appear.

    Any ideas?

    Thanks again.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    place the code properly in the Workbook_Open event then. You must have typed it into the wrong module

    In the VB Editor select WorkBook from the left drop down.

    In the right drop down find WorkBool_Open

    Paste your code there

    Also, specify which sheet the combo is on

    Please Login or Register  to view this content.

+ 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