View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Dynamic Range Selection 1,000 rows at a time

One way:

Public Sub SelectLotsOfRows()
Const cnRowsToSelect As Long = 1000
Static nStart As Long
Static nMax As Long

With Sheets("Sheet1")
If ActiveSheet.Name = .Name Then
If nMax = 0 Then
nStart = 1
nMax = .Rows.Count - cnRowsToSelect
Else
nStart = nStart + cnRowsToSelect
If (nStart .UsedRange.SpecialCells(xlLastCell).Row) Or _
(nStart nMax) Then nStart = 1
End If
.Cells(nStart, 1).Resize(cnRowsToSelect).EntireRow.Select
End If
End With
End Sub

In article ,
Kirk P. wrote:

I have a list of over 127,000 transaction_id's in Excel. I'm looking for a
way to automate the selection of the first 1,000 items in the list, then the
next 1,000 and so on until it reaches the bottom.

Help?