ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Set position of non frooze rows when panes are frooze (https://www.excelbanter.com/excel-programming/404556-set-position-non-frooze-rows-when-panes-frooze.html)

Aaron

Set position of non frooze rows when panes are frooze
 
I have a macro running with sheets that have panes frooze, lets say row one
is frooze. At the end of the macro the activities of the macro are such that
the first visible row after one is say row six (2-5 have gotten rolled up
behind frozen row one) How do I say at the end of my code "Next row after
frooze pane that is visible is row 2"?

Per Jessen

Set position of non frooze rows when panes are frooze
 
Hi Aron

ActiveCell.End(xlUp).Offset(1, 0).Select

// Per
"Aaron" skrev i en meddelelse
...
I have a macro running with sheets that have panes frooze, lets say row one
is frooze. At the end of the macro the activities of the macro are such
that
the first visible row after one is say row six (2-5 have gotten rolled up
behind frozen row one) How do I say at the end of my code "Next row after
frooze pane that is visible is row 2"?




Rick Rothstein \(MVP - VB\)

Set position of non frooze rows when panes are frooze
 
I am not sure that will work if there are any blank rows above the currently
active cell. I think this will work though...

Cells(2, ActiveCell.Column).Select

Rick


"Per Jessen" wrote in message
...
Hi Aron

ActiveCell.End(xlUp).Offset(1, 0).Select

// Per
"Aaron" skrev i en meddelelse
...
I have a macro running with sheets that have panes frooze, lets say row
one
is frooze. At the end of the macro the activities of the macro are such
that
the first visible row after one is say row six (2-5 have gotten rolled up
behind frozen row one) How do I say at the end of my code "Next row
after
frooze pane that is visible is row 2"?





Aaron

Set position of non frooze rows when panes are frooze
 
Ok, worked great, but did not work at all when filters where applied. Anyway
to say cells(first filtered row, 1).select?

"Rick Rothstein (MVP - VB)" wrote:

I am not sure that will work if there are any blank rows above the currently
active cell. I think this will work though...

Cells(2, ActiveCell.Column).Select

Rick


"Per Jessen" wrote in message
...
Hi Aron

ActiveCell.End(xlUp).Offset(1, 0).Select

// Per
"Aaron" skrev i en meddelelse
...
I have a macro running with sheets that have panes frooze, lets say row
one
is frooze. At the end of the macro the activities of the macro are such
that
the first visible row after one is say row six (2-5 have gotten rolled up
behind frozen row one) How do I say at the end of my code "Next row
after
frooze pane that is visible is row 2"?






Rick Rothstein \(MVP - VB\)

Set position of non frooze rows when panes are frooze
 
Try this macro... I think it will work for either case (Filter on/off)...

Sub GoToTop()
Dim X As Long
For X = 2 To Rows.Count
If Range("A" & CStr(X)).Height 0 Then
ActiveSheet.Cells(X, ActiveCell.Column).Activate
Exit For
End If
Next
End Sub

Rick


"Aaron" wrote in message
...
Ok, worked great, but did not work at all when filters where applied.
Anyway
to say cells(first filtered row, 1).select?

"Rick Rothstein (MVP - VB)" wrote:

I am not sure that will work if there are any blank rows above the
currently
active cell. I think this will work though...

Cells(2, ActiveCell.Column).Select

Rick


"Per Jessen" wrote in message
...
Hi Aron

ActiveCell.End(xlUp).Offset(1, 0).Select

// Per
"Aaron" skrev i en meddelelse
...
I have a macro running with sheets that have panes frooze, lets say row
one
is frooze. At the end of the macro the activities of the macro are
such
that
the first visible row after one is say row six (2-5 have gotten rolled
up
behind frozen row one) How do I say at the end of my code "Next row
after
frooze pane that is visible is row 2"?







All times are GMT +1. The time now is 07:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com