How to freeze a sheet without Freeze Panes

bthumble

Board Regular
Joined
Dec 18, 2007
Messages
239
Hello everyone?

I have a tab labeled "Main" and would like to freeze the data on the tab so that nobody can scroll up and down on the tab so that the macro buttons are always visible. Tried using Freeze Panes but it will still allow a part of the worksheet to be scrolled.

Thanks in advance!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Where are the macro buttons? Preventing scrolling sounds like an imposition on your users.

I give the first row a tall height, put the buttons in the first row, and then freeze panes at row #2. This example does it for rows 1 & 2 for reasons not shown here.

1723489508412.png
 
Upvote 0
Place two procedures in the ThisWorkbook module:
VBA Code:
Private Sub Workbook_Activate()
    If ActiveSheet.CodeName = "Sheet1" Then
        Sheet1.ScrollArea = "A1"
    End If
End Sub

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
    If Sh.CodeName = "Sheet1" Then
        Sheet1.ScrollArea = "A1"
    End If
End Sub
Note that sheet code names are used.

Artik
 
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,793
Members
451,589
Latest member
Harold14

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top