GOTO

  • Thread starter Thread starter carl
  • Start date Start date
C

carl

I have a long list (33,000) of items and have the list
sorted based on category 1 and 2. Is there a way to
quickly go to the last item in categrory 1/first item in
category 2?
 
Sub findfirst()
x = Columns("B").Find("c").Address
MsgBox x
End Sub

Sub FindLast()
i = Cells(Rows.Count, "b").End(xlUp).Row
For i = i To 1 Step -1
If Cells(i, 2).Value = "c" Then
MsgBox Cells(i, 2).Address
Exit For
End If
Next
If i = 0 Then MsgBox "Not there"
End Sub

Here's one to select it
Sub FindInColumnB()
Dim rng As Range
Set rng = _
Columns(2).Find(What:="C", After:=Cells(Rows.Count, "b"), _
LookIn:=xlFormulas, LookAt:=xlWhole, _
SearchOrder:=xlByRows, SearchDirection:=xlPrevious, _
MatchCase:=False)

If Not rng Is Nothing Then
rng.Select
Else
MsgBox "C not found"
End If
End Sub
 
Here is anorher way. Put a label on top of the list. Select the first
entry of the list and invoke autofilter, now invoke Widows\freeze
panes. Press the autofilter arrow and select the first category. Go to
the last entry shown, by pressing end and Down Arrow. Press the
autofilter arrow and select All. The cursor is now on the last entry
of category 1.
Ilan
 
Back
Top