| 
    
     |  | ▼Yamayama さん: おはようございます。
 インパクトのない投稿をしてしまったので気がつかなかったのでしょう・・・。
 投稿したコードは、単にWithステートメントで囲んだだけではありません。
 
 >Private Sub CommandButton1_Click()
 with combobox2
 >'項目
 Cells(ComboBox1.Value + 0, 2) = .List(.ListIndex, 0)
 >'称呼
 Cells(ComboBox1.Value + 0, 4) = .List(.ListIndex, 1)
 >'単価
 Cells(ComboBox1.Value + 0, 5) = .List(.ListIndex, 2)
 >'番号
 Cells(ComboBox1.Value + 0, 10) = .List(.ListIndex, 3)
 >'原価
 Cells(ComboBox1.Value + 0, 11) = .List(.ListIndex, 4)
 end with
 
 項目を例に挙げれば、
 
 ・・・・=.List(.ListIndex, 0)
 
 Yamayama さんが変更したコードと見比べてみて下さい。
 
 Listindexの前に「.」が付いています。
 
 
 |  |