Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Scroll to top of page code
I have a worksheet where the first 6 rows are 'frozen' When a worksheet is activated, I would like the sheet to be 'scrolled to the top. Tired Range.("A7").select, however the worksheet does no scroll to the top. Would appreciate anyone helping with the suggested code to make thi happen. Cheers Peter (new to VBA -- peter.thompso ----------------------------------------------------------------------- peter.thompson's Profile: http://www.excelforum.com/member.php...fo&userid=2968 View this thread: http://www.excelforum.com/showthread.php?threadid=50153 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Scroll to top of page code
Enter this code in the sheet in question:
Private Sub Worksheet_Activate() Range("A7").Select End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Scroll to top of page code
Hi Mark, I've tried that, the cursor moves to the cell, but the page doesn't 'scroll up' for some reason... Cheers Peter -- peter.thompson ------------------------------------------------------------------------ peter.thompson's Profile: http://www.excelforum.com/member.php...o&userid=29686 View this thread: http://www.excelforum.com/showthread...hreadid=501532 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Scroll to top of page code
Hi Peter,
Try: '============= Private Sub Worksheet_Activate() Application.Goto Reference:=Range("A7"), Scroll:=True End Sub '<<============= This is worksheet event code and should be pasted into the worksheets's code module (not a standard module and not the workbook's ThisWorkbook module): Right-click the worksheet's tab Select 'View Code' from the menu and paste the code. Alt-F11 to return to Excel. --- Regards, Norman "peter.thompson" <peter.thompson.21paum_1137370203.5501@excelforu m-nospam.com wrote in message news:peter.thompson.21paum_1137370203.5501@excelfo rum-nospam.com... I have a worksheet where the first 6 rows are 'frozen' When a worksheet is activated, I would like the sheet to be 'scrolled' to the top. Tired Range.("A7").select, however the worksheet does not scroll to the top. Would appreciate anyone helping with the suggested code to make this happen. Cheers Peter (new to VBA) -- peter.thompson ------------------------------------------------------------------------ peter.thompson's Profile: http://www.excelforum.com/member.php...o&userid=29686 View this thread: http://www.excelforum.com/showthread...hreadid=501532 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Scroll to top of page code
Thanks Norman, that did it. Cheers Peter -- peter.thompson ------------------------------------------------------------------------ peter.thompson's Profile: http://www.excelforum.com/member.php...o&userid=29686 View this thread: http://www.excelforum.com/showthread...hreadid=501532 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Scroll to top of page code
Peter, I'm puzzled -- I get the same behavior both with my code and
with Norman's, and I've never had mine fail in use in any worksheet in which I've used it. I'm curious as to why my code didn't work for you. Did you run it in the worksheet's code module? |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Scroll to top of page code
Hi Mark, Am doing a few other things at the same time, see code below. Probabl why it isn't working in this scenario. Unfortunately I'm too much of newbie to figure out why! Sincerely appreciate your asistance. Public Sub Worksheet_Activate() Application.ScreenUpdating = False Password = "djdog" ActiveSheet.Unprotect Password Cells.Select Selection.EntireRow.Hidden = False Application.Goto Reference:=Range("A7"), Scroll:=True Cheers Pete -- peter.thompso ----------------------------------------------------------------------- peter.thompson's Profile: http://www.excelforum.com/member.php...fo&userid=2968 View this thread: http://www.excelforum.com/showthread.php?threadid=50153 |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Scroll to top of page code
Public Sub Worksheet_Activate()
Application.ScreenUpdating = False Password = "djdog" ActiveSheet.Unprotect Password Cells.Select Selection.EntireRow.Hidden = False Application.Goto Reference:=Range("A7"), Scroll:=True Peter, I don't know for sure, but I'd think turning off ScreenUpdating is keeping your original code from working. I've never needed to keep the screen from updating while using my code. Norman's code forces the scrolling where your original code (and mine) do not. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do you have the headings scroll down the page as you move dow | Excel Worksheet Functions | |||
How do I get my arrows to scroll the cells not the page? | Excel Discussion (Misc queries) | |||
how to have my titles move down as i scroll down the page | Excel Discussion (Misc queries) | |||
Moving Page with Scroll Bar | Excel Discussion (Misc queries) | |||
VBA code to scroll all the way to the top | Excel Programming |