|
いつも拝見させて貰い参考にしています。
ユーザーに投入位置を特定させた後,その位置に基づいてフォームから
シートへデータを投入する為の記述をしました。
↓
Private Sub CommandButton1_Click()
If UserForm5.TextBox29.Value = "1" Then
If UserForm5.OptionButton1.Value = True Then
Cells(9, 6) = TextBox2.Value
Cells(9, 7) = TextBox7.Value
Cells(9, 3) = ComboBox1.Value
Cells(9, 4) = ComboBox2.Value
Cells(9, 5) = ComboBox3.Value
Cells(9, 10) = TextBox28.Value
Cells(9, 18) = ComboBox4.Value
Cells(9, 19) = ComboBox5.Value
Cells(9, 36) = ComboBox6.Value
Cells(9, 37) = ComboBox7.Value
Cells(9, 20) = ComboBox8.Value
Cells(9, 9) = ComboBox9.Value
Cells(9, 12) = ComboBox10.Value
Cells(9, 14) = ComboBox11.Value
Cells(9, 13) = ComboBox12.Value
Cells(9, 15) = TextBox26.Value
Cells(9, 16) = TextBox25.Value
Cells(9, 17) = TextBox24.Value
Cells(9, 22) = TextBox15.Value
Cells(9, 23) = TextBox14.Value
Cells(9, 24) = TextBox13.Value
Cells(9, 25) = TextBox16.Value
Cells(9, 27) = TextBox17.Value
Cells(9, 28) = TextBox18.Value
Cells(9, 29) = TextBox19.Value
Cells(9, 32) = TextBox20.Value
Cells(9, 33) = TextBox22.Value
Cells(9, 34) = TextBox21.Value
Cells(9, 35) = TextBox23.Value
End If
End If
If UserForm5.TextBox29.Value = "1" Then
If UserForm5.OptionButton2.Value = True Then
Cells(10, 6) = TextBox2.Value
Cells(10, 7) = TextBox7.Value
Cells(10, 3) = ComboBox1.Value
Cells(10, 4) = ComboBox2.Value
Cells(10, 5) = ComboBox3.Value
Cells(10, 10) = TextBox28.Value
Cells(10, 18) = ComboBox4.Value
Cells(10, 19) = ComboBox5.Value
Cells(10, 36) = ComboBox6.Value
Cells(10, 37) = ComboBox7.Value
Cells(10, 20) = ComboBox8.Value
Cells(10, 9) = ComboBox9.Value
Cells(10, 12) = ComboBox10.Value
Cells(10, 14) = ComboBox11.Value
Cells(10, 13) = ComboBox12.Value
Cells(10, 15) = TextBox26.Value
Cells(10, 16) = TextBox25.Value
Cells(10, 17) = TextBox24.Value
Cells(10, 22) = TextBox15.Value
Cells(10, 23) = TextBox14.Value
Cells(10, 24) = TextBox13.Value
Cells(10, 25) = TextBox16.Value
Cells(10, 27) = TextBox17.Value
Cells(10, 28) = TextBox18.Value
Cells(10, 29) = TextBox19.Value
Cells(10, 32) = TextBox20.Value
Cells(10, 33) = TextBox22.Value
Cells(10, 34) = TextBox21.Value
Cells(10, 35) = TextBox23.Value
End If
End If
If UserForm5.TextBox29.Value = "1" Then
If UserForm5.OptionButton3.Value = True Then
.................
............................
この後,延々と続く(34×5行=170行=170セット)のですが
これではプロシージャが大きすぎて処理出来ません。
(ヘルプでは64KBまでの処理と制限)
プロシージャを分割する良い方法はないものでしょうか?
ちなみに,34×5行とは,項目番号1に対して5行分のデータを投入す
るフォーマットになっているからです.....
|
|