hier eine Variante ...
02.12.2008 10:58:46
Matthias
Hallo
ins Tabellenblatt1:
Private Sub Worksheet_Activate()
With Worksheets("Tabelle2")
If .Cells(1, 3).Value "" Then CommandButton1.Caption = .Cells(1, 3).Value Else _
CommandButton1.Caption = "Frei"
If .Cells(2, 3).Value "" Then CommandButton2.Caption = .Cells(2, 3).Value Else _
CommandButton2.Caption = "Frei"
If .Cells(3, 3).Value "" Then CommandButton3.Caption = .Cells(3, 3).Value Else _
CommandButton3.Caption = "Frei"
If .Cells(4, 3).Value "" Then CommandButton4.Caption = .Cells(4, 3).Value Else _
CommandButton4.Caption = "Frei"
If .Cells(5, 3).Value "" Then CommandButton5.Caption = .Cells(5, 3).Value Else _
CommandButton5.Caption = "Frei"
If .Cells(6, 3).Value "" Then CommandButton6.Caption = .Cells(6, 3).Value Else _
CommandButton6.Caption = "Frei"
If .Cells(7, 3).Value "" Then CommandButton7.Caption = .Cells(7, 3).Value Else _
CommandButton7.Caption = "Frei"
If .Cells(8, 3).Value "" Then CommandButton8.Caption = .Cells(8, 3).Value Else _
CommandButton8.Caption = "Frei"
If .Cells(9, 3).Value "" Then CommandButton9.Caption = .Cells(9, 3).Value Else _
CommandButton9.Caption = "Frei"
If .Cells(10, 3).Value "" Then CommandButton10.Caption = .Cells(10, 3).Value Else _
CommandButton10.Caption = "Frei"
End With
End Sub
die Namen stehn in Tab2 in C1:C10
Gruß Matthias