Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Grd Grd is offline
external usenet poster
 
Posts: 118
Default get a list of sheet names onto a listbox on a form

HI,

I'm creating a form that will allow me to switch sheets instead of using the
tabs at the bottom (I have created this form already). How do I get the names
of the sheets onto the listbox on the form.

Thanks in advance

Grd


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default get a list of sheet names onto a listbox on a form

Try this event in the userform module

Private Sub UserForm_Initialize()
For Each ws In ActiveWorkbook.Sheets
If ws.Visible = True Then
Me.ListBox1.AddItem (ws.Name)
End If
Next
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Grd" wrote in message ...
HI,

I'm creating a form that will allow me to switch sheets instead of using the
tabs at the bottom (I have created this form already). How do I get the names
of the sheets onto the listbox on the form.

Thanks in advance

Grd




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default get a list of sheet names onto a listbox on a form

Userform1.Listbox1.Clear
For Each sh In Activeworkbook.Sheets
Userform1.Listbox1.AddItem sh.Name
Next sh

add this code in the userform somewhere, activate event probably.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Grd" wrote in message
...
HI,

I'm creating a form that will allow me to switch sheets instead of using

the
tabs at the bottom (I have created this form already). How do I get the

names
of the sheets onto the listbox on the form.

Thanks in advance

Grd




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populating listbox with sheet names johnb Excel Discussion (Misc queries) 1 May 16th 08 12:33 PM
How do I import a list of names into a separate form that prints . Paul Smith Excel Worksheet Functions 1 October 8th 05 07:22 PM
Sheet names in a form dropdown Rob Hargreaves[_2_] Excel Programming 3 July 18th 05 11:05 PM
Create drop list on form from range names? Ed Excel Programming 2 February 15th 05 03:56 PM
ListBox with hidden and visible sheet names? Rockee052[_43_] Excel Programming 8 February 20th 04 09:36 AM


All times are GMT +1. The time now is 09:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"