Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a userform which I load values into via a combobox as follows below.
I want to load these values the first time the user calls the form up. After load the form, the user then picks an item from the box and I pass this to a public variable via the combobox change event. The user is then prompted away from this form and then brought back later. Now when the user comes back to this form again, I want to bypass the loading of the combobox but instead retain the value from the public variable. How do I do this? I am assuming an If stmt which tests to see if this is the first time the form has been called or would you use a class module for this? Private Sub UserForm_Initialize() Dim pg As Control Dim sht As Worksheet With UserForm1.ComboBox1 .AddItem "Black" .AddItem "Blue" .AddItem "Red" .AddItem "Green" .AddItem "Yellow" .AddItem "Orange" .AddItem "White" End With End Sub Private Sub ComboBox1_Change() cmblistvalue = ComboBox1.Value UserForm2.Label1.Caption = cmblistvalue End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Private Sub - Called from Userform | Excel Discussion (Misc queries) | |||
Userform to have Last Updated Values Time & Date Displayed ?? | Excel Programming | |||
Passing a value from 1 userform to another when you dont know who called it. | Excel Programming | |||
How to make userform disappear while called subroutine is running | Excel Programming | |||
Opening a UserForm causes a crash in the Exit procedure (Which is never called) | Excel Programming |