![]() |
VBA code to scroll all the way to the top
Hi,
This spreadsheet contains 5 sheets. Each sheet has more than 3000 rows of data. Can you tell me the VBA code: a. Which takes the vertical scroll all the way to the top. b. Where shold the code be located such that each time the user clicks on tab of the respective sheet then this code gets executed. So the user can scroll up and down in any sheet but whenever he goes to another sheet the vertical scroll is always at the top. Thanks. Luther ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
VBA code to scroll all the way to the top
Hi Luther
Paste this in the ThisWorkbook module: Private Sub Workbook_SheetActivate(ByVal Sh As Object) ActiveWindow.ScrollRow = 1 Cells(1, 1).Select End Sub -- HTH. Best wishes Harald Followup to newsgroup only please "lothario" skrev i melding ... Hi, This spreadsheet contains 5 sheets. Each sheet has more than 3000 rows of data. Can you tell me the VBA code: a. Which takes the vertical scroll all the way to the top. b. Where shold the code be located such that each time the user clicks on tab of the respective sheet then this code gets executed. So the user can scroll up and down in any sheet but whenever he goes to another sheet the vertical scroll is always at the top. Thanks. Luther ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
VBA code to scroll all the way to the top
Thanks guys.
This helped. ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
All times are GMT +1. The time now is 12:03 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com