Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You have some follow up questions at your other post.
MVM wrote: I am having a combobox on a worksheet. I like to fill it in the worksheet_open() function. In VBA how do i get these methods? - additem, dataitem, list etc for combobox. I declared a worksheet wb code in thisworkbook -------------------- Option Explicit Public DeptLocRange As Range, AcctRange As Range Public ws As Worksheet Private Sub Workbook_Open() Dim r As Integer Set ws = Me.Worksheets("Expenses") With ws Set DeptLocRange = .Range(.Cells(79, 3), .Cells(86, 6)) Set AcctRange = .Range(.Cells(91, 3), .Cells(92, 16)) r = 2 DeptLocRange.Select ' Worksheets("Expenses").cmbLocation.AddItem ("<select Loc") ' While Not IsNull(DeptLocRange(r, 1)) ' .cmbLocation.AddItem = DeptLocRange(r, 1) ' Wend ' .cmbLocation.ListIndex = 0 ' .cmbDepartment.ListIndex = 0 End With Worksheets("Expenses").cmbLocation.ListIndex = 0 Worksheets("Expenses").cmbDepartment.ListIndex = 0 End Sub -------------------- commented lines are not working. wb.cmbLocation.listindex won't work. but the last two lines works. Any help is greatly appreciated. Thanks MVMurthy -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Collection methods | Excel Programming | |||
3 possible methods for adding value to a combobox | Excel Programming | |||
Populating ComboBox Methods | Excel Programming | |||
Populating Combobox Methods | Excel Programming | |||
Handout of Excel Object's Properties and Methods | Excel Programming |