Row and Column Viewing

G

Gord Dibben

Rude

The code I gave works only on one sheet......Sheet1....and does not affect any
other sheet in the workbook.

Code is placed in the ThisWorkbook module and runs when workbook is opened.

Copy the code then right-click on the Excel Icon just left of "File" on main
Menu.

Select "View Code". Paste in there.

Private Sub Workbook_Open()
Sheets("Sheet1").ScrollArea = "A1:p20"
End Sub

If you wanted several sheets to have the scrollarea set to different areas,
you could add sheets to the above code or enter the code into
Worksheet_Activate code in each separate sheet.

Private Sub Worksheet_Activate()
ScrollArea = "A1:p20"
End Sub

That code would be placed into a Worksheet Module.

Right-click on a sheet tab and "View Code". Paste in there.

Watch out with this however. If you save the workbook with a sheet having the
Worksheet_Activate code being the active sheet, the code will not run when you
open the file. Only when the sheet is activated is the scrollarea set.

Gord
 
Top