Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Worksheet(s) open to last used row

Greetings, I have a workbook with 50+ worksheets in it. Each day when I
launch my workbook I have to scroll down to the last few visible rows to be
able to enter in the new data for the day. Every time, 50 times... It's
getting a little tedious. Is there a way to code the worksheet/workbook so
that the worksheet opens up so that the last two or three filled rows are
visible at the top of the worksheet?

(I keep thinking, "If it default opens to the first row, surely there is a
way to get it to default open to the "x" row...")
Thanks,
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Worksheet(s) open to last used row

Hi,

Alt + F11 to open VB editor. Doubleclick 'ThisWorkbook' and paste this in on
the right. Each time you select a sheet it will leave 4 rows of the ised
range at the top

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
On Error Resume Next

LastRow = Cells.Find(What:="*", After:=[A1], _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row

With ActiveWindow
..ScrollRow = LastRow - 3
End With
End Sub


Mike

"PapaBear" wrote:

Greetings, I have a workbook with 50+ worksheets in it. Each day when I
launch my workbook I have to scroll down to the last few visible rows to be
able to enter in the new data for the day. Every time, 50 times... It's
getting a little tedious. Is there a way to code the worksheet/workbook so
that the worksheet opens up so that the last two or three filled rows are
visible at the top of the worksheet?

(I keep thinking, "If it default opens to the first row, surely there is a
way to get it to default open to the "x" row...")
Thanks,

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Worksheet(s) open to last used row

Thanks Mike - it worked perfectly. However, it uncovered a detail that I had
forgotten so I did not mention earlier. I currently use columns "A" through
"H" for my regular entries, way down in column "AA" I had added a row with a
formula using the "COUTNBLANKS" function and some command buttons to use as
an error checking alert to make sure that nobody forgets to fill in the
cells. (I have the fonts in this column as "white" so that you can't see
them, which is why I forgot about them). This column is prefilled all the
way to row 400, so as you probably have guessed, your code is tripping on
this column. Is there a way to limit the rows scanned to just "A:H" so that
it will disregard column "AA"? Thanks again for your help. PB

"Mike H" wrote:

Hi,

Alt + F11 to open VB editor. Doubleclick 'ThisWorkbook' and paste this in on
the right. Each time you select a sheet it will leave 4 rows of the ised
range at the top

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
On Error Resume Next

LastRow = Cells.Find(What:="*", After:=[A1], _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row

With ActiveWindow
.ScrollRow = LastRow - 3
End With
End Sub


Mike

"PapaBear" wrote:

Greetings, I have a workbook with 50+ worksheets in it. Each day when I
launch my workbook I have to scroll down to the last few visible rows to be
able to enter in the new data for the day. Every time, 50 times... It's
getting a little tedious. Is there a way to code the worksheet/workbook so
that the worksheet opens up so that the last two or three filled rows are
visible at the top of the worksheet?

(I keep thinking, "If it default opens to the first row, surely there is a
way to get it to default open to the "x" row...")
Thanks,

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Worksheet(s) open to last used row

Wow! perfect, works like a champ - thanks for the help.

"Mike H" wrote:

Hi,

Just use column A

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
On Error Resume Next
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
With ActiveWindow
.ScrollRow = LastRow - 3
End With
End Sub


Mike

"PapaBear" wrote:

Thanks Mike - it worked perfectly. However, it uncovered a detail that I had
forgotten so I did not mention earlier. I currently use columns "A" through
"H" for my regular entries, way down in column "AA" I had added a row with a
formula using the "COUTNBLANKS" function and some command buttons to use as
an error checking alert to make sure that nobody forgets to fill in the
cells. (I have the fonts in this column as "white" so that you can't see
them, which is why I forgot about them). This column is prefilled all the
way to row 400, so as you probably have guessed, your code is tripping on
this column. Is there a way to limit the rows scanned to just "A:H" so that
it will disregard column "AA"? Thanks again for your help. PB

"Mike H" wrote:

Hi,

Alt + F11 to open VB editor. Doubleclick 'ThisWorkbook' and paste this in on
the right. Each time you select a sheet it will leave 4 rows of the ised
range at the top

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
On Error Resume Next

LastRow = Cells.Find(What:="*", After:=[A1], _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row

With ActiveWindow
.ScrollRow = LastRow - 3
End With
End Sub


Mike

"PapaBear" wrote:

Greetings, I have a workbook with 50+ worksheets in it. Each day when I
launch my workbook I have to scroll down to the last few visible rows to be
able to enter in the new data for the day. Every time, 50 times... It's
getting a little tedious. Is there a way to code the worksheet/workbook so
that the worksheet opens up so that the last two or three filled rows are
visible at the top of the worksheet?

(I keep thinking, "If it default opens to the first row, surely there is a
way to get it to default open to the "x" row...")
Thanks,

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Worksheet(s) open to last used row

Your welcome, I'm glad that helped and thanks for the feedback

Mike

"PapaBear" wrote:

Wow! perfect, works like a champ - thanks for the help.

"Mike H" wrote:

Hi,

Just use column A

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
On Error Resume Next
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
With ActiveWindow
.ScrollRow = LastRow - 3
End With
End Sub


Mike

"PapaBear" wrote:

Thanks Mike - it worked perfectly. However, it uncovered a detail that I had
forgotten so I did not mention earlier. I currently use columns "A" through
"H" for my regular entries, way down in column "AA" I had added a row with a
formula using the "COUTNBLANKS" function and some command buttons to use as
an error checking alert to make sure that nobody forgets to fill in the
cells. (I have the fonts in this column as "white" so that you can't see
them, which is why I forgot about them). This column is prefilled all the
way to row 400, so as you probably have guessed, your code is tripping on
this column. Is there a way to limit the rows scanned to just "A:H" so that
it will disregard column "AA"? Thanks again for your help. PB

"Mike H" wrote:

Hi,

Alt + F11 to open VB editor. Doubleclick 'ThisWorkbook' and paste this in on
the right. Each time you select a sheet it will leave 4 rows of the ised
range at the top

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
On Error Resume Next

LastRow = Cells.Find(What:="*", After:=[A1], _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row

With ActiveWindow
.ScrollRow = LastRow - 3
End With
End Sub


Mike

"PapaBear" wrote:

Greetings, I have a workbook with 50+ worksheets in it. Each day when I
launch my workbook I have to scroll down to the last few visible rows to be
able to enter in the new data for the day. Every time, 50 times... It's
getting a little tedious. Is there a way to code the worksheet/workbook so
that the worksheet opens up so that the last two or three filled rows are
visible at the top of the worksheet?

(I keep thinking, "If it default opens to the first row, surely there is a
way to get it to default open to the "x" row...")
Thanks,

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get a blank worksheet to open up when I open Excel? Art@ISCO Setting up and Configuration of Excel 0 July 17th 07 01:30 PM
Specify what worksheet to open first Michele Excel Worksheet Functions 1 January 22nd 07 06:11 PM
Wish to add a WORKSHEET but 'WORKSHEET' not open in 'INSERT' Zona Excel Worksheet Functions 1 September 6th 06 03:52 AM
'Save current worksheet'; 'Open next worksheet' - two command buttons englishmustard Excel Discussion (Misc queries) 1 April 7th 06 12:54 PM
How do I get my personal macro worksheet to open whenever I open . Claudia_R Excel Discussion (Misc queries) 3 December 9th 04 11:59 PM


All times are GMT +1. The time now is 12:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"