title image


Smiley VBA Ausdruck kürzen
Hallo,



da ich noch nicht so bewandert in VBA bin hätte ich da wahrscheinlich nochmal eine einfache Frage an Euch:



Kann ich das auch kürzer schreiben?



Private Sub opt_gruppe_Click()

If Me!opt_gruppe = 1 Then

kon1_voi.Visible = True

kon2_voi.Visible = True

kon3_voi.Visible = True

kon4_voi.Visible = True

kon5_voi.Visible = True

konin1_voi.Visible = True

konin2_voi.Visible = True

konin3_voi.Visible = True

konin4_voi.Visible = True

konin5_voi.Visible = True

kon1_desk.Visible = False

kon2_desk.Visible = False

kon3_desk.Visible = False

kon4_desk.Visible = False

konin1_desk.Visible = False

konin2_desk.Visible = False

konin3_desk.Visible = False

konin4_desk.Visible = False

Else

kon1_voi.Visible = False

kon2_voi.Visible = False

kon3_voi.Visible = False

kon4_voi.Visible = False

kon5_voi.Visible = False

konin1_voi.Visible = False

konin2_voi.Visible = False

konin3_voi.Visible = False

konin4_voi.Visible = False

konin5_voi.Visible = False

If Me!opt_gruppe = 2 Then

kon1_desk.Visible = True

kon2_desk.Visible = True

kon3_desk.Visible = True

kon4_desk.Visible = True

konin1_desk.Visible = True

konin2_desk.Visible = True

konin3_desk.Visible = True

konin4_desk.Visible = True

kon1_voi.Visible = False

kon2_voi.Visible = False

kon3_voi.Visible = False

kon4_voi.Visible = False

kon5_voi.Visible = False

konin1_voi.Visible = False

konin2_voi.Visible = False

konin3_voi.Visible = False

konin4_voi.Visible = False

konin5_voi.Visible = False

Else

kon1_desk.Visible = False

kon2_desk.Visible = False

kon3_desk.Visible = False

kon4_desk.Visible = False

konin1_desk.Visible = False

konin2_desk.Visible = False

konin3_desk.Visible = False

konin4_desk.Visible = False

End If

End If

End Sub



Denn ich hab nämlich 7 verschiedene Werte in meiner Optionsgruppe und pro Wert vielleicht so ca. 20 Felder...



Gruß und Dank,

Jokii
..::Also wenn ich nicht wüsste Sie wären es, dann würde ich sagen Sie sind es::..

geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: