|
▼HoMa さん:こんにちわ、ちんといいます。
visibleで表示、非表示できます。
Private Sub UserForm_Initialize()
Label1.Caption = "あああ"
Label3.Caption = "いいい"
Label5.Caption = "ううう"
For i = 1 To 5 Step 2
UserForm1.Controls("Label" & i).Visible = False
Next i
End Sub
Private Sub CommandButton1_Click()
Dim i As Variant
Dim lab As Variant
lab = Array("1", "3", "5")
For Each i In lab
'' cap = UserForm1.Controls("label" & i).Caption
With UserForm1.Controls("TextBox" & i)
If .Value <> "" Then
UserForm1.Controls("Label" & i).Visible = True
Else
UserForm1.Controls("Label" & i).Visible = False
End If
End With
Next i
End Sub
以上、参考までに・・・
|
|