Scroll Area Problem

G

Guest

I have a problem in that I set a scroll area on a sheet in VBA, press the
save button in VBA, and then return to my worksheet, test the scroll area,
and it works perfectly. I then save the workbook, and close it. When I open
it again, it asks me wether I want to enable macros, so I do enable them, but
find that the scrool limits have dissapeared in VBA, and do not work in the
sheet.
Can anyone help/explain what I'm doing wrong?

Tim
 
G

Guest

The scroll area setting does not save when the workbook is closed. You have
to set it manually with the workbook_open event.
 
G

Guest

In ThisWorkbook paste the following:
Private Sub Workbook_Open()
Sheets("mysheet").ScrollArea = "A1:D10"
End Sub

Make sure to change the sheet name and range. You can repeat the line for
all the sheets you want to limit.
 
G

Guest

Where do I need the "'s and, should I use the Name of the sheet or the (name)
of the sheet?
 
G

Guest

I always use the sheet name that appears in excel on the sheet tab. Doing
this you need to use the quotation marks. If you refer to the sheet number
as provided by VBA you do not need the quote marks.
 
G

Guest

I have got this code in the branch "microsoft excel projects", then "Sheet2
(Room Sessions):
Private Sub Workbook_Open()
Sheets("Room Sessions").ScrollArea = A1: AA72
End Sub

Yet this still does not help.
 
G

Guest

It can't be in the sheets code. It has to be in the "ThisWorkbook" code.
Also, you need quotes around the area listed as the scroll area. Also remove
the space after the colon.

In VBA, unless something is defined in VBA itself (not even excel) or a
number it must have quotes around it.
 

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

Similar Threads

Setting Scroll Area 1
Worksheet Scroll Increment 2
Scroll Area 1
Scroll function in VBA 5
Problem with scroll area 1
How to limit scrollable area 3
Moving Shape 3
Scroll Area 3

Top