| 
    
     |  | こんにちは,9月7日の質問『プロシージャが大きすぎて処理出来ない』を参考 に,ワークシートの指定した位置へのデータ投入について作成させて頂いてま
 すが,このような事例を利用して、逆に指定した位置からユーザーフォーム上に
 データを表示させると言う事は可能でしょうか?
 ちなみに、その時のコードは、
 ↓
 =======================================
 Private Sub CommandButton1_Click()
 Dim idx As Long
 Dim t_val As Variant
 t_val = Val(TextBox29.Value)
 If Int(t_val) = t_val And t_val >= 1 And t_val <= 34 Then
 '        Textbox29の値が1〜34だったら?
 For idx = 1 To 5
 If Controls("OptionButton" & idx).Value = True Then
 Exit For
 End If
 Next idx
 
 If idx < 6 Then
 Call set_form_data(t_val * 5 + idx + 3)
 '                ↑この計算式で書き込む行を算出
 End If
 End If
 End Sub
 '============================================================
 Sub set_form_data(rw As Variant)
 Cells(rw, 6) = TextBox2.Value
 Cells(rw, 7) = TextBox7.Value
 Cells(rw, 3) = ComboBox1.Value
 Cells(rw, 4) = ComboBox2.Value
 Cells(rw, 5) = ComboBox3.Value
 Cells(rw, 10) = TextBox28.Value←この部分を変えればと言うのは単純?
 Cells(rw, 18) = ComboBox4.Value
 Cells(rw, 19) = ComboBox5.Value
 Cells(rw, 36) = ComboBox6.Value
 Cells(rw, 37) = ComboBox7.Value
 Cells(rw, 20) = ComboBox8.Value
 Cells(rw, 9) = ComboBox9.Value
 Cells(rw, 12) = ComboBox10.Value
 Cells(rw, 14) = ComboBox11.Value
 Cells(rw, 13) = ComboBox12.Value
 Cells(rw, 15) = TextBox26.Value
 Cells(rw, 16) = TextBox25.Value
 Cells(rw, 17) = TextBox24.Value
 Cells(rw, 22) = TextBox15.Value
 Cells(rw, 23) = TextBox14.Value
 Cells(rw, 24) = TextBox13.Value
 Cells(rw, 25) = TextBox16.Value
 Cells(rw, 27) = TextBox17.Value
 Cells(rw, 28) = TextBox18.Value
 Cells(rw, 29) = TextBox19.Value
 Cells(rw, 32) = TextBox20.Value
 Cells(rw, 33) = TextBox22.Value
 Cells(rw, 34) = TextBox21.Value
 Cells(rw, 35) = TextBox23.Value
 End Sub
 
 この例では,2つの指定要素に基づいて投入位置を計算して位置を特定して
 います。
 何か,VLookup関数やIndex関数を利用したケースよりも簡単そうに出来そうな
 感じがしまして....と言うよりVLookup関数やIndex関数の利用に悪戦苦闘し
 ているのが本音ですが....
 
 |  |