Case Anweisung
10.09.2005 20:05:42
Excelmania
Is es möglich folgenden VBA Code kürzer zu schreiben evtl irgendwie mit ner Case Anweisung oder so was. (Kenne leider die Syntax nicht genau für ne Case Anweisung)
If TagNum = 1 Then
If RegalForm1.OptionButton_Ansicht_Gesamt.Value = True Then
RegalForm1.Label_1_1.Caption = ItemValue
End If
ThisWorkbook.Worksheets("HORELAST_Protokoll").Cells(8, 2) = ItemValue
End If
If TagNum = 2 Then
If RegalForm1.OptionButton_Ansicht_Gesamt.Value = True Then
RegalForm1.Label_1_2.Caption = ItemValue
End If
ThisWorkbook.Worksheets("HORELAST_Protokoll").Cells(9, 2) = ItemValue
End If
If TagNum = 3 Then
If RegalForm1.OptionButton_Ansicht_Gesamt.Value = True Then
RegalForm1.Label_1_3.Caption = ItemValue
End If
ThisWorkbook.Worksheets("HORELAST_Protokoll").Cells(10, 2) = ItemValue
End If
If TagNum = 4 Then
If RegalForm1.OptionButton_Ansicht_Gesamt.Value = True Then
RegalForm1.Label_1_4.Caption = ItemValue
End If
ThisWorkbook.Worksheets("HORELAST_Protokoll").Cells(11, 2) = ItemValue
End If
Also das ganze geht noch weiter bis TagNum 99
Über Hilfe wie immer froh
Grüsse
Dirk