Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
array worksheets
i want to build a sheet navigator with a combobox.
I have the next code that this but not the way i want I Don't want all the sheets to be in the combobox and except that i don't want to appear in the combobox with their sheetnames so i thought to built an array with tree options 1.sheename 2.Name appear in the combobox 3. Index sheet number for the (combobox change) Can anyone help? Private Sub ComboBox1_Change() On Error Resume Next Sheets(ComboBox1.Text).Select End Sub Private Sub ComboBox1_DropButtonClick() ComboBox1.Clear Dim i As Long ComboBox1.Clear With ActiveWorkbook For i = 1 To .Worksheets.Count If .Worksheets(i).Visible = True Then ComboBox1.AddItem .Worksheets(i).Name End If Next i End With End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
array worksheets
Private Sub ComboBox1_DropButtonClick()
Dim varr Dim i As Long With ActiveWorkbook Redim varr(1 to .Worksheets.count, 1 to 3) ComboBox1.Clear j = 0 For i = 1 To .Worksheets.Count If .Worksheets(i).Visible = True Then j = j + 1 varr(j,1) = .worksheets(i).Name varr(j,2) = "?" varr(j,3) = i End If Next i End With Combobox1.List = varr End Sub -- Regards, Tom Ogilvy GUS wrote in message ... i want to build a sheet navigator with a combobox. I have the next code that this but not the way i want I Don't want all the sheets to be in the combobox and except that i don't want to appear in the combobox with their sheetnames so i thought to built an array with tree options 1.sheename 2.Name appear in the combobox 3. Index sheet number for the (combobox change) Can anyone help? Private Sub ComboBox1_Change() On Error Resume Next Sheets(ComboBox1.Text).Select End Sub Private Sub ComboBox1_DropButtonClick() ComboBox1.Clear Dim i As Long ComboBox1.Clear With ActiveWorkbook For i = 1 To .Worksheets.Count If .Worksheets(i).Visible = True Then ComboBox1.AddItem .Worksheets(i).Name End If Next i End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can a SUMPRODUCT array formula be used across multiple worksheets? | Excel Discussion (Misc queries) | |||
Array across multiple worksheets | Excel Discussion (Misc queries) | |||
Array formula referencing other worksheets | Excel Worksheet Functions | |||
Two worksheets, one array | Excel Discussion (Misc queries) | |||
printing an array of worksheets | Excel Discussion (Misc queries) |