Private Sub DataGrid1_SelChange(Cancel As Integer)
Dim lIdx As Long, lFrom As Long, lTo As Long
lIdx = DataGrid1.SelBookmarks.Count
If lIdx = 2 Then
lFrom = DataGrid1.SelBookmarks(0)
lTo = DataGrid1.SelBookmarks(1)
Dim iStep As Integer
If lTo < lFrom Then
lTo = lTo + 1
lFrom = lFrom - 1
iStep = -1
Else
lTo = lTo - 1
lFrom = lFrom + 1
iStep = 1
End If
For lIdx = lFrom To lTo Step iStep
DataGrid1.SelBookmarks.Add lIdx
Next lIdx
End If
End Sub