View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
exalan exalan is offline
external usenet poster
 
Posts: 28
Default Limit Scrollarea

Hi Tom

Many thanks for the advice...
--
exalan


"Tom Hutchins" wrote:

Try this alternate code:

Right-click the name tab of the sheet where the scroll area should be
limited. Select View Code from the menu that pops up. You will be taken to
the Visual Basic Editor (VBE), and the code page for that worksheet will be
displayed. Enter the following code:

Private Sub Worksheet_Activate()
Me.ScrollArea = "A1:G50"
End Sub

Press Alt-Q to leave the VBE. Save your workbook. This code should limit the
scroll area for that sheet only whenever that sheet is activated.

Hutch

"exalan" wrote:

Hi Gaurav & Hutchins

Thanks for advice. However, tried your method but somehow, it still didn;t
work.
--
exalan


"Tom Hutchins" wrote:

The scrollarea method does not persist between sessions, so you will have to
reset it each time you open the workbook. You may wish to place this code
into a WorkBook_Open sub in the ThisWorkbook module:

Private Sub WorkBook_Open()
Sheets("Sheet1").ScrollArea = "A1:G50"
End Sub

Hope this helps,

Hutch

"exalan" wrote:

How can I limit scrollarea say, from A1 to G50 only. i tried the following
macro, press F4 to state Scrollarea to be A1:G50. However, each time after
i've saved and re-open the file, the setting of Scrollarea in the property
(press F4) is gone and therefore the limit scrollarea is not working:

Private Sub Scroll_Area()
Worksheets("Sheet1").ScrollArea = "A1:G50"
End Sub


Please help....

--
exalan