View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
exceluserforeman exceluserforeman is offline
external usenet poster
 
Posts: 45
Default Problems with Combo Box


Enter Design Mode
Make The Name of the combobox
cboSheets

Open Vb Editor

Tools Macro Visual Basic Editor
Double-Click on This Workbook icon in the Project Properties.



On the code sheet the drop down reads (General). Change this to" Workbook"
A sub is created called workbook_open


Workbook_Open()
Dim i as integer
for i = 1 to sheets.count
cboSheets.additem sheets(i).name
next
cbosheets.listindex=0
end sub

Double-Click on Sheet1 properties icon
You should see Sub cboSheets_Change()


Sub cboSheets_Change()
sheets(cboSheets.text).select

or

sheets(cboSheets.list(cboSheets.listindex).select
end sub





"aalam" wrote:

Hello all,
here is the problem that I'm experiencing. I have the an ComboBox1 inserted
from control toolbar, all I want is to be able to change the sheets by
clicking in the combobox like sheet1, sheet2, and sheet3. Only three sheets
will do for now. But I have problem populating the combobox with sheet names
lets call them sheet1..2 etc. How do I go about. It is fairly simple but how
is it done. ?I am using excel 2000 on XP Pro.

I have named the combobox to Sheet1 in the properties by right clicking on
it, now what.?