ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   keep last row added visible on the screen (https://www.excelbanter.com/excel-programming/417369-keep-last-row-added-visible-screen.html)

BilBull

keep last row added visible on the screen
 
I add rows to a sheet by a macro.
I want to keep the last row added visible on the screen , no matter what is
the size of the window is.

Thanks

AR

Gary Keramidas

keep last row added visible on the screen
 
don't know what your code looks like, but maybe you can adapt this to do what
you want:

Sub test()
Dim ws As Worksheet
Dim lastrow As Long
Set ws = Worksheets("sheet1")
lastrow = ws.Cells(Rows.Count, "A").End(xlUp).Row

Application.Goto ws.Range("A" & lastrow - 20), scroll:=True
End Sub

--


Gary


"BilBull" wrote in message
...
I add rows to a sheet by a macro.
I want to keep the last row added visible on the screen , no matter what is
the size of the window is.

Thanks

AR




Barb Reinhardt

keep last row added visible on the screen
 
Try putting a select for the last row added.
--
HTH,
Barb Reinhardt




"BilBull" wrote:

I add rows to a sheet by a macro.
I want to keep the last row added visible on the screen , no matter what is
the size of the window is.

Thanks

AR


BilBull

keep last row added visible on the screen
 


"Gary Keramidas" wrote:

don't know what your code looks like, but maybe you can adapt this to do what
you want:

Sub test()
Dim ws As Worksheet
Dim lastrow As Long
Set ws = Worksheets("sheet1")
lastrow = ws.Cells(Rows.Count, "A").End(xlUp).Row

Application.Goto ws.Range("A" & lastrow - 20), scroll:=True
End Sub

--


Gary


"BilBull" wrote in message
...
I add rows to a sheet by a macro.
I want to keep the last row added visible on the screen , no matter what is
the size of the window is.

Thanks

AR






All times are GMT +1. The time now is 04:09 PM.

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