| 
    
     |  | いつもお世話になっています。 
 ユーザーフォームにCommandButtonが15個あります。
 
 Private Sub CommandButton142_Click()                         TextBox1.Value = ""
 Range("B" & ActiveCell.Row).Value = ""
 Range("D" & ActiveCell.Row).Value = ""
 Range("A" & ActiveCell.Row).Value = 1
 End Sub
 Private Sub CommandButton143_Click()
 TextBox1.Value = ""
 Range("B" & ActiveCell.Row).Value = ""
 Range("D" & ActiveCell.Row).Value = ""
 Range("A" & ActiveCell.Row).Value = 2
 End Sub
 Private Sub CommandButton144_Click()
 TextBox1.Value = ""
 Range("B" & ActiveCell.Row).Value = ""
 Range("D" & ActiveCell.Row).Value = ""
 Range("A" & ActiveCell.Row).Value = 3
 End Sub
 
 後、12個あります。
 
 Sheetには、VLOOK関数が入って、A列の数字は、コードNoです。
 このCommandButtonの15個をもっとスマートにする方法を
 教えてください。
 宜しくお願いします。
 
 |  |