| 
    
     |  | おはようございます。 
 >説明が下手で私の言っていることが分かりづらいかもしれませんが、もし分かる方がいれば教えて頂ければ幸いです。
 
 非常にわかりやすい記述です。
 
 >
 >参考例
 >    A列
 >1  20070512233708
 >2  20070513124506
 >3  20070514162324
 >4  20070515081313
 >5  20070516055728
 >6  20070517154234
 >
 >こういった日付があって、inputboxで20070513120000と入力したら入力した値より大きい最初のセルを指定したいので、"A2"です。
 >そして次のinputboxで20070517120000と入力したら入力した値より小さい最初のセルを指定したいので"A5"で、A2からA5を選択したいのです。
 >
 >inputboxを2回使うのがおかしいのでしょうか?
 データ入力のインターフェースは、ユーザーフォームを使う等の方法もありますが、
 今回は、おっしゃられているInputboxを使いました。
 
 データは、例に示されたようにアクティブシートのA1からA2,A3・・・と
 昇順に入力されているとします。
 
 
 標準モジュールに
 '==========================================================
 Sub main()
 Dim st As Variant
 Dim ed As Variant
 Dim r_st As Range
 Dim r_ed As Range
 Dim g0 As Long
 Set r_st = Nothing
 Set r_ed = Nothing
 st = Application.InputBox("開始", , , , , , , 1)
 If TypeName(st) = "Boolean" Then Exit Sub
 ed = Application.InputBox("終了", , , , , , , 1)
 If TypeName(ed) = "Boolean" Then Exit Sub
 If st <= ed Then
 With Range("a1", Cells(Rows.Count, "a").End(xlUp))
 For g0 = 1 To .Count
 If r_st Is Nothing Then
 If .Cells(g0).Value > st Then
 Set r_st = .Cells(g0)
 End If
 Else
 If .Cells(g0) < ed Then
 Set r_ed = .Cells(g0)
 Else
 Exit For
 End If
 End If
 Next
 End With
 If (Not r_st Is Nothing) And (Not r_ed Is Nothing) Then
 Range(r_st, r_ed).Select
 End If
 End If
 If r_st Is Nothing Or r_ed Is Nothing Then
 MsgBox "条件にあったデータはないよ"
 End If
 End Sub
 
 上記のコードは入力された日付時刻データと個々のデータを比較して
 条件範囲内のセルを見つけています。
 
 
 別解として、標準モジュールに
 
 '===========================================
 Sub main2()
 Dim st As Variant
 Dim ed As Variant
 Dim r_st As Long
 Dim r_ed As Long
 Dim ret As Long
 ret = 0
 st = Application.InputBox("開始", , , , , , , 1)
 If TypeName(st) = "Boolean" Then Exit Sub
 ed = Application.InputBox("終了", , , , , , , 1)
 If TypeName(ed) = "Boolean" Then Exit Sub
 If st <= ed Then
 With Range("a1", Cells(Rows.Count, "a").End(xlUp))
 '例 入力セル範囲がA1:A6、
 '  st=20070513120000,ed=20070517120000の場合、
 'r_stは、
 ' min(if($A$1:$A$6>20070513120000,row($A$1:$A$6)))
 'r_edは、
 ' max(if($A$1:$A$6<20070517120000,row($A$1:$A$6)))
 'こんな配列数式を評価します
 r_st = Evaluate("min(if(" & .Address & ">" & st & ",row(" & .Address & ")))")
 r_ed = Evaluate("max(if(" & .Address & "<" & ed & ",row(" & .Address & ")))")
 If r_st > 0 And r_ed > 0 Then
 Range(Cells(r_st, 1), Cells(r_ed, 1)).Select
 Else
 ret = 1
 End If
 End With
 Else
 ret = 1
 End If
 If ret = 1 Then MsgBox "条件にあったデータはないよ"
 End Sub
 
 上記は、配列数式を使って条件範囲内のセルを見つけています。
 
 ふたつのコードは、ふたつとも条件にあったセル範囲を選択するという結果を
 残します。
 
 条件にあったデータがない場合は、その主旨のエラーメッセージを表示します。
 
 
 試してみてください。
 
 |  |