"Kev Nurse" wrote
Max, thanks for that suggestion. Its certainly a step in the right
direction. However, to add to the problem, I have multiple columns on the
same worksheet and every one of them must have this function. Can the
scroll area code be applied to the column of the selected cell? I would
be
prepared to write out the code for up to 15 columns. Thanks for any help.
The closest fit I found from googling the Excel newsgroup archives
is this previous post by Don Guilett ..
By Don Guillett Oct 3 2003, 8:44 am
microsoft.public.excel.programming
Try this assigned to a button or shape
--- begin vba ---
Sub Multiscroll()
With ActiveSheet
Select Case InputBox("select area 1,2,or 3 ONLY")
Case 1
..ScrollArea = "a1:a10"
Case 2
..ScrollArea = "b50:c100"
Case 3
..ScrollArea = "d25:d100"
Case Else
..ScrollArea = "a1:a1"
End Select
End With
End Sub
--- end vba ---
"R. Todd Miller" wrote
I'm using Excel 97. Is it possible to use Activesheet.Scrollarea on
several non-contiguous ranges? For example, restrict the user to
A1:A10, B50:C100, and D25:D100?
Note: Unfortunately I can't protect the worksheet and use
Worksheets("Sheet1").EnableSelection = xlUnlockedCells
--
To implement:
Press Alt + F11 to go to VBE
In VBE, Click Insert Module
Paste Don's Sub Multiscroll() there
(everything within the dotted lines)
Press Alt+Q to go back to Excel
In say, Sheet1, draw a rectangle (say) on the sheet
Right-click on the rectangle Assign macro
Select "Multiscroll" OK
Click on the rectangle to fire the sub
It'll bring up an inputbox for the user to input 1, 2 or 3
Inputting "1" OK will restrict the scroll
to the area defined under Case 1 (.ScrollArea = "a1:a10")
And so on ..
You might be able to adapt Don's sub to suit ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
|