AW: Sprechblase
29.11.2012 12:30:03
Rudi
Hallo,
füge eine Userform ein.
Darein diesen Code:
Private Sub UserForm_Activate()
Dim lblA As Control, lblB As Control, i As Integer, j As Integer
Const h = 15
Const w = 35
Const BCol1 = &HC0FFFF
Const BCol2 = &HFFFFFF
For j = 0 To 2
Set lblA = Controls.Add("forms.label.1")
With lblA
.Height = h
.Width = w
.Left = j * w * 2
.Top = 0
.Caption = "Min."
.BackColor = BCol1
End With
Set lblB = Controls.Add("forms.label.1")
With lblB
.Height = h
.Width = w
.Left = lblA.Left + w
.Top = lblA.Top
.Caption = "Dez."
.BackColor = BCol1
End With
Next
For j = 0 To 2
For i = 1 To 20
Set lblA = Controls.Add("forms.label.1")
With lblA
.Height = h
.Width = w
.Left = j * w * 2
.Top = i * h
.Caption = j * 20 + i
End With
Set lblB = Controls.Add("forms.label.1")
With lblB
.Height = h
.Width = w
.Left = lblA.Left + w
.Top = lblA.Top
.Caption = Format((j * 20 + i) / 60, "0.000")
End With
If ((i + j) Mod 2) = 0 Then
lblA.BackColor = BCol2
lblB.BackColor = BCol2
End If
Next
Next
Me.Height = 22 * h + 5
Me.Width = 6 * w
Me.Caption = "Umrechnungstabelle"
End Sub
Für den Button:
Private Sub CommandButton1_Click()
UserForm1.Show False
End Sub
Gruß
Rudi