Private Sub Workbook_Open() Dim S(2) As String S(0) = "バラ" S(1) = "サクラ" S(2) = "キク" Sheet1.CommandButton1.Caption = "実行" Sheet1.Label1.Caption = "花の名前を選択してください" Sheet1.ListBox1.List = S Sheet1.ListBox1.Font.Size = 12 Sheet1.ListBox1.ListIndex = -1 Sheet1.ListBox1.IntegralHeight = False End Sub
Sub Macro1() res = Sheet1.ListBox1.ListIndex dp = 1 End Sub