ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   command to show top of worksheet? (https://www.excelbanter.com/excel-programming/332409-command-show-top-worksheet.html)

davegb

command to show top of worksheet?
 
I have a series of worksheets in a single workbook. I'd like to have
them display showing the top (cell A1) of the sheet when the workbook
is opened. I already have an Auto Open macro to remove previously
applied filters and other stuff. I put in the following to get the top
of the sheet to show on opening:

..LargeScroll Down:=-10

This just scrolls up (not sure why "Down" is up?) on each sheet. But it
only works because the sheets are relatively short. I'd have to use
-100 or -1000 on larger sheets, then test to see if it worked. Is there
a simpler way of having each sheet display from the top on opening?
Thanks to all!


Tom Ogilvy

command to show top of worksheet?
 
for each sh in Thisworkbook.Worksheets
Sh.Activate
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
Next

or

for each sh in thisworkbook.Worksheets
sh.Activate
sh.Range("A1").Select
Next

--
Regards,
Tom Ogilvy


"davegb" wrote in message
oups.com...
I have a series of worksheets in a single workbook. I'd like to have
them display showing the top (cell A1) of the sheet when the workbook
is opened. I already have an Auto Open macro to remove previously
applied filters and other stuff. I put in the following to get the top
of the sheet to show on opening:

.LargeScroll Down:=-10

This just scrolls up (not sure why "Down" is up?) on each sheet. But it
only works because the sheets are relatively short. I'd have to use
-100 or -1000 on larger sheets, then test to see if it worked. Is there
a simpler way of having each sheet display from the top on opening?
Thanks to all!




davegb

command to show top of worksheet?
 
Thanks again, Tom!
I had already tried the range("A1").select, but it didn't work. Not
sure why that would be.
Your ScrollRow/ScrollColumn works great!


Tom Ogilvy wrote:
for each sh in Thisworkbook.Worksheets
Sh.Activate
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
Next

or

for each sh in thisworkbook.Worksheets
sh.Activate
sh.Range("A1").Select
Next

--
Regards,
Tom Ogilvy


"davegb" wrote in message
oups.com...
I have a series of worksheets in a single workbook. I'd like to have
them display showing the top (cell A1) of the sheet when the workbook
is opened. I already have an Auto Open macro to remove previously
applied filters and other stuff. I put in the following to get the top
of the sheet to show on opening:

.LargeScroll Down:=-10

This just scrolls up (not sure why "Down" is up?) on each sheet. But it
only works because the sheets are relatively short. I'd have to use
-100 or -1000 on larger sheets, then test to see if it worked. Is there
a simpler way of having each sheet display from the top on opening?
Thanks to all!




All times are GMT +1. The time now is 10:08 PM.

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