コードを書き直していますが、それを正しく実行するための構文が正しくないようです。私はforループを使用して、コマンドボタンの配列を生成し、その可視性を制御したいと考えています。私はループ内で作業している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' –
である必要があり、私が追加されている必要があり、これらのボタンは、フォーム上にあります。 – Flibertyjibbet
同じ原則ですが、以下の回答もあります。 –