| 
            Private Sub CommandButton2_Click()
 
 'ループ処理でリストボックスに追加
 
 
 Dim lstRow2 As Long
 Dim i As Long 'シートの行番号
 Dim q As Long 'リストボックスの行番号
 
 
 MsgBox "ループ処理でリストボックスに追加します。 結果は同じです。"
 
 ListBox1.Clear 'リストボックスの値を削除しておく。
 ListBox1.ColumnCount = 3 '3列表示
 ListBox1.ColumnWidths = "40 pt;40 pt;40 pt"  '表示する列の幅
 
 '================================================================
 
 lstRow2 = Cells(65536, "B").End(xlUp).Row '最終行の取得
 q = 0 'リストボックスの行番号
 
 For i = 7 To lstRow2  '7行目から最終行までリストに追加する
 
 With ListBox1
 .AddItem
 .List(q, 0) = Cells(i, "B").Value      '1列目
 .List(q, 1) = Cells(i, "C").Value      '2列目
 .List(q, 2) = Cells(i, "D").Value      '3列目
 
 End With
 
 q = q + 1 'リストボックスの行番号
 
 
 Next
 
 
 '================================================================
 
 
 End Sub
 
 
 
 |