update combobox with sheet names

J

Johnnyb

I have created an excel spreadsheet which uses a macro connected to
button to create and rename new sheets, How can I get a combo box t
store and update these sheet names as they are created?

Thankyou,

Regards,

Johnny
 
K

keepITcool

Keeping track of sheets added is easy.
Tracking if sheets are renamed is not so easy..

Why dont you populate the combo when it is selected ?

Private Sub ComboBox1_GotFocus()
Dim i%
With Sheets
ReDim lst(1 To .Count)
For i = 1 To .Count
lst(i) = Sheets(i).Name
Next
End With
ComboBox1.List = lst
End Sub


keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 

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