| 
    
     |  | ▼かみちゃん さん: 
 こんにちは。
 >TextBoxの日付が2009/3/10ならなんとなくわかるのですが、
 そのとおりですl
 
 >挿入位置の基準がわかりません。
 >もしかして、A3ではなく、A列の最終行(A4セル)という意味ですか?
 最終行の時もありますが、セルの日付と比較?して適切な位置に挿入したいのです。
 
 右も左もわからず作って見ます田。
 
 Private Sub CommandButton1_Click()
 Dim rRow As Long
 Dim i As Long
 
 With Worksheets("メイン予定")
 rRow = .Cells(65536, 1).End(xlUp).Row + 1
 For i = rRow To 1 Step -1
 Select Case TextBox1.Text
 Case Is = .Cells(rRow, 1).Value <<<これが解らない!
 rRow = rRow + 1
 Exit For
 Case Is > .Cells(rRow, 1).Value
 Exit For
 Case Is < .Cells(rRow, 1).Value
 Rows(i).Insert shift:=xlDown
 Exit For
 End Select
 Next i
 
 .Cells(rRow, 1).Value = TextBox1.Value
 
 End With
 
 End Sub
 
 よろしくお願いします。
 
 
 |  |