Row and Column Viewing

  • Thread starter Thread starter RudeRam
  • Start date Start date
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top