Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

list sheets available in listbox

Status
Not open for further replies.

drewdaman

Programmer
Joined
Aug 5, 2003
Messages
302
Location
CA
hello,

i would like to list the available sheets in a list box. how can i do this?

also, i would like to give the user the option to create a new sheet from a form.. any ideas?

thanks!
 
sorry.. i said list box.. i meant combo box
 

This is quite primative, but you can use something like this (on the UserForm1 code page - drop a combo box and a command button first.):
Code:
Private Sub CommandButton1_Click()
  Sheets.Add
End Sub

Private Sub UserForm_Initialize()
Dim i As Integer
  For i = 1 To Sheets.Count
    ComboBox1.AddItem Sheets.Item(i).Name
  Next i
  ComboBox1.ListIndex = 0
End Sub
 
well.. if it does waht i think it does, it is exactly what i need. thank you very much. i will try it out and get back to you tomorrow.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top