ComboBox

G

Guest

I am trying to have the workbook tab names come up in a ComboBox on my cover
sheet and store the value as a string variable for later use. I have tried
using some of the suggestions listed here and modifying them but with no
luck. Any sugestions?
 
B

Bob Phillips

Private Sub ComboBox1_DropButtonClick()
Dim sh As Worksheet
ComboBox1.Clear
For Each sh In ActiveWorkbook.Worksheets
ComboBox1.AddItem sh.Name
Next sh
End Sub

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
G

Guest

I have tried that but it says but it says 'Object Required" at
ComboBox1.Clear. I diminsioned CombBox1 as a ComboBox and got past there but
it then comes up 'Object variable or block variable not set.' on the same
line.
 
B

Bob Phillips

What combobox are you using, the forms toolbar or the controls toolbar?

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
G

Guest

Got it thanks

Bob Phillips said:
What combobox are you using, the forms toolbar or the controls toolbar?

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top