Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm help
I have a workbook that creates additional worksheets (added on at the end of
the worksheets.) The first 3 worksheets in the workbook are used in the code to create the additional worksheets. I have a userform that is used to export the additional worksheets. This userform contains a combo box that is filled with the additional worksheets (sheets 4 and on.) When the userform loads, I have worksheets 4 and and beyond's names saved to an array which fills the combo box. However after I add new worksheets and launch the userform the additional worksheets are not showing up on the combo box. If I save the workbook and re-open it then the combo box will recognize the new worksheet names. I have attached my code below. Any help is much appreciated.... Private Sub UserForm_Initialize() Dim sheetnames() As String Dim totalsheets As Integer Dim sheet As Worksheet Dim i As Integer totalsheets = ActiveWorkbook.Worksheets.Count - 3 ReDim sheetnames(totalsheets) For i = 1 To totalsheets sheetnames(i - 1) = ActiveWorkbook.Worksheets(i + 3).Name Next For i = 0 To totalsheets - 1 UserForm1.ComboBox1.AddItem sheetnames(i) Next End Sub Thanks, Ray |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Is there an easy Copy/Paste of a Userform ? (Entire Userform Including tx & cbx's) | Excel Programming | |||
Userform to enter values and shown in same userform in list | Excel Programming | |||
Looping procedure calls userform; how to exit loop (via userform button)? | Excel Programming | |||
Activating userform and filling it with data form row where userform is activate | Excel Programming | |||
Access from add_in userform to main template userform.... | Excel Programming |