|
もう見て居ないかな?
ゴメン、もっと簡単に成ります?
Option Explicit
'設定するLableの個数
Private Const clngNumb As Long = 3
Private vntLetter As Variant
Private Sub UserForm_Initialize()
Dim i As Long
vntLetter = Array("○", "△", "□")
For i = 1 To clngNumb
With Controls("Label" & i)
.Tag = 0
.Caption = vntLetter(0)
End With
Next i
End Sub
Private Sub Label1_Click()
LabelClicked Label1
End Sub
Private Sub Label2_Click()
LabelClicked Label2
End Sub
Private Sub Label3_Click()
LabelClicked Label3
End Sub
Private Sub LabelClicked(lblMark As MSForms.Label)
Dim lngCount As Long
lngCount = (UBound(vntLetter) + 1)
With lblMark
.Tag = (.Tag + 1) Mod lngCount
.Caption = vntLetter(.Tag Mod lngCount)
End With
End Sub
|
|