ctrl-home macro

A

Arien

Can anyone tell me what the macrocommand is for
the ctrl-home keycommand.
I need to go to the fist cell of a filtered list after a macro makes a
filtered list of my orders.

(Goto does not work since the reference changes)

Thank you.

Arien, Eindhoven N
 
D

Debra Dalgleish

I use this code, posted by Dave Peterson, to select column A in the
first filtered row.

'========================
Sub GetFirstRow()
'posted by Dave Peterson 2003/03/15

Dim curWks As Worksheet
Dim rng As Range
Dim rngF As Range

Set curWks = ActiveSheet

With curWks
If Not .AutoFilterMode Then
MsgBox "Please apply a filter"
Exit Sub
End If

If Not .FilterMode Then
MsgBox "you haven't filtered anything"
Exit Sub
End If

Set rng = .AutoFilter.Range

Set rngF = Nothing
On Error Resume Next
With rng
'just first column of filtered range
Set rngF = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _
.SpecialCells(xlCellTypeVisible)
End With
On Error GoTo 0

If rngF Is Nothing Then
MsgBox "Filter showed nothing"
Else
.Cells(rngF(1).Row, 1).Select
End If

End With

End Sub
'===========================
 
Top