SendKeys "(^ {HOME})"
I might use sendkeys in this case.
But if you want...
Option Explicit
Sub testme()
Dim myRow As Long
Dim myCol As Long
Dim myCell As Range
With ActiveWindow
myRow = .SplitRow
myCol = .SplitColumn
End With
Set myCell = Nothing
On Error Resume Next
With ActiveSheet
Set myCell = .Range(.Cells(myRow + 1, myCol + 1), _
.Cells(.rows.Count, .Columns.Count)) _
.Cells.SpecialCells(xlCellTypeVisible).Cells(1)
End With
On Error GoTo 0
If myCell Is Nothing Then
'do nothing
Beep
Else
myCell.Select
End If
End Sub
Marco wrote:
There are...and the code below sends me to a hidden cell.
Here is more detail: the freeze is actually at X3. Columns L to W are
hidden and A to K are outside of the window. I need to end up at X3 this
time around. Next time it could be AG7.
I truely appreciate the help.
"Dave Peterson" wrote:
Maybe...
Option Explicit
Sub testme()
Dim myRow As Long
Dim myCol As Long
With ActiveWindow
myRow = .SplitRow
myCol = .SplitColumn
End With
ActiveSheet.Cells(myRow + 1, myCol + 1).Select
'or
Application.Goto reference:=ActiveSheet.Cells(myRow + 1, myCol + 1), _
Scroll:=True
End Sub
But it can get uglier if you have hidden rows/columns at that frozen pane.
Marco wrote:
I have read that I should avoid using SendKeys at all cost. How else can I
get the cursor to the upper-left most cell (assume a window freeze at c3)
that would emulate the CTL + HOME keys?
The code above is not working.
Thanks.
Marco
--
Dave Peterson
--
Dave Peterson
|