Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2006
    Posts
    47

    Unanswered: working with a combo box in sheet 1

    I have a cbo in sheet 1 called cboSelect. I would like to write code in a module that will fire when the file is opened, but dont know how i can run code in a module that will run from the workbook open even and fill a combo box in sheet 1

    (thisworkbook)
    Private Sub Workbook_Open()
    FillCbo 'This will be in module1 of the current worksheet
    End Sub

    (module1)
    Sub FillCbo()
    Dim i As Integer

    For i = 2 To Sheets("SYMBOL TABLE").UsedRange.Rows.Count
    cboSelect.AddItem (Sheets("SYMBOL TABLE").Range("A" & i).Value)
    Next
    End Sub

  2. #2
    Join Date
    Jun 2006
    Location
    Colton, CA
    Posts
    26
    So which part doesn't work?
    Geek it till it mHz

  3. #3
    Join Date
    Oct 2003
    Posts
    311
    Actually i figured it out i need to qualify code in modeule1 : Module1.RunThis and all references to the combo box need to be qualified by the sheet :
    sheets(1).CboSelect.addItem("New item")


    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •