Formulier Initialize pas correct na gebruik knop in formulier

Status
Niet open voor verdere reacties.

Cedexis

Gebruiker
Lid geworden
26 jun 2010
Berichten
16
Beste,

In VBA (excel) heb ik een formulier gemaakt met enkele comboboxen.
De keuzes in de comboboxen wordt pas zichtbaar (en kiesbaar) wanneer ik op de knop "formulier wissen" klik. (de code daarachter is call userform2.initialize).

Wanneer het formulier dus op auto_open wordt geopend lijkt hij de initialize niet automatisch/goed uit te voeren, namelijk;
- geen keuzes in comboboxen
- niet uitvoeren opdracht togglebuttons
- niet uitvoeren opdracht range op werkblad wissen ("")

Iemand een idee?
Voor de info heb ik de initializecode hieronder ingevoegd.
Als er meer info gewenst is verneem ik het natuurlijk graag!
Alvast bedankt!

Code:
Private Sub Userform2_initialize()

ActiveWorkbook.Sheets("Initiatie").Activate

ComboBox1.RowSource = "Initiatie!P2:P6"
ComboBox2.RowSource = "Initiatie!P2:P6"
ComboBox3.RowSource = "Initiatie!P2:P6"
ComboBox4.RowSource = "Initiatie!P2:P6"
ComboBox5.RowSource = "Initiatie!P2:P6"
ComboBox6.RowSource = "Initiatie!P8:P12"
ComboBox7.RowSource = "Initiatie!P8:P12"
ComboBox8.RowSource = "Initiatie!P8:P12"
ComboBox9.RowSource = "Initiatie!P8:P12"
ComboBox10.RowSource = "Initiatie!P8:P12"

TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
TextBox4.Value = ""
TextBox5.Value = ""
TextBox6.Value = ""
TextBox7.Value = ""
TextBox8.Value = ""
TextBox9.Value = ""
TextBox10.Value = ""
TextBox11.Value = ""
TextBox12.Value = ""
TextBox13.Value = ""
TextBox14.Value = ""
TextBox15.Value = ""
TextBox16.Value = ""
TextBox17.Value = ""
TextBox18.Value = ""

Range("D50").Value = ""
Range("E50:E54").Value = ""
Range("C57:C58").Value = ""

ToggleButton1 = True
ToggleButton2 = False
ToggleButton3 = True
ToggleButton4 = False

TextBox1.SetFocus

End Sub
 
Haal die 2 eens weg in:


Private Sub Userform2_initialize()

;)
 
Damn... haha dat is inderdaad de oplossing... Noob... SUPER!
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan