일부 코드를 다시 작성하고 생각했지만 제대로 실행하려면 구문을 올바르게 처리 할 수 없습니다. 나는 for 루프를 사용하여 commandbutton의 배열을 생성하고 가시성을 제어하고자한다. 루프에서 작업중인 CommandButton 번호를 정의하려면 구문을 사용하는 데 도움이 필요합니다. 예를 들어, CommandButton1, CommandButton2 등VBA Variable as CommandButton #
Public Sub LoadLots(sName As String, streamLots() As String)
Label1.Caption = sName
For o = 1 To 9
If streamLots(o) <> "" Then
CommandButton& o &.Caption = streamLots(o)
CommandButton& o & .Visable = True
Else
CommandButton& o & .Visable = False
End If
Next
End Sub
'Activesheet.Shapes ("있는 명령"& O) .Caption' ... 또한'Visable'이어야 Visible' I '가 추가되어야 –
는이 버튼 폼이다. – Flibertyjibbet
동일한 원칙이지만 아래 답변도 있습니다. –