Freezing columnes and rows

B

Brenda

I have created a program in excel however i don't want people to be able to
scroll to the right after column F and i don't want them to be able to scroll
after row 27 how can i do this so that they can only view what is inside
those two areas? Do i have to create a macro? If i do what would the Macro
code be? Help is greatly appreciated.
 
B

Brenda

That isn't what i am looking for i did get that to work but you can still
scroll down and i don't want them to be able to scroll down at all. How do i
fix that please refer to my orginal message. thanks
 
J

John C

You could go one step further.
First, click in cell G28, then go to menu Window|Freeze Panes
Second, as before, hide columns G through IV
Third, hide rows 28 through 65536 (both assumptions is that you have xl2003.
Now, your block of data stays there no matter how much 'scrolling is
attempted. For aesthetics, you could go to menu Tools|Options, and uncheck
the checkbox for Row & column heaers on the View tab, and then it won't even
'bump out a little' when they scroll down.
 
F

F.G.

You could go one step further.
First, click in cell G28, then go to menu Window|Freeze Panes
Second, as before, hide columns G through IV
Third, hide rows 28 through 65536 (both assumptions is that you have xl2003.
Now, your block of data stays there no matter how much 'scrolling is
attempted. For aesthetics, you could go to menu Tools|Options, and uncheck
the checkbox for Row & column heaers on the View tab, and then it won't even
'bump out a little' when they scroll down.

--
John C






- Show quoted text -

And to go a bit further you can unlock the visible cell if they need
to be modified, then protect the sheet by allowing the user to select
unlocked cells. After this even if someone wants to unhide the hidden
content it wouldn't be possible.

Note: this is an extra step to do if you follow John C advise.

Frank G
 
G

Gord Dibben

You could set the scrolling area through VBA

Since the scrollarea method does not stick between sessions you will have to
reset it each time you open the workbook.

You may wish to place the code into a WorkBook_Open Sub in ThisWorkbook
module and specify which worksheet if only one sheet required.

Adjust the sheetname and range to suit.

Private Sub WorkBook_Open()
Sheets("YourSheet").ScrollArea = "A1:F27"
End Sub

Or this in the Thisworkbook module to limit scrollarea on all sheets.

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
With ActiveSheet
.ScrollArea = "A1:F27"
End With
End Sub


Gord Dibben MS Excel MVP
 
B

Brenda

when i apply this code and i scroll to the right why can't i scroll back to
the left when there is text.
 
G

Gord Dibben

Sorry Brenda but I don't understand what you're asking.

Setting the scrollarea allows you scroll within that set area only.

i.e. A1:F27 in the example posted


Gord
 
Top