View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Marco Marco is offline
external usenet poster
 
Posts: 69
Default SendKeys "(^ {HOME})"

It would be the upper left cell under and to the left of the frozen
rows/column.

I tried both codes you provided and the second one takes me to the cell next
to the labels [the equivalent to A1 on a non-frozen sheet]. The other code
gave me an error at the "If not ...." line.

Thanks for your help.

"Chip Pearson" wrote:

Do you mean to get to the upper left cell of the Pane containing the active
cell? If so, try

Dim P As Pane
Dim N As Long
If ActiveSheet.Type = xlWorksheet Then
For N = 1 To ActiveWindow.Panes.Count
Set P = ActiveWindow.Panes(N)
If Not Application.Intersect(ActiveCell, P.VisibleRange) Is Nothing
Then
P.VisibleRange(1, 1).Select
Exit For
End If
Next N
End If


Otherwise, try

If ActiveSheet.Type = xlWorksheet Then
ActiveWindow.Panes(1).VisibleRange.Cells(1, 1).Select
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)



"Marco" wrote in message
...
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