#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Scroll Area

Is there any way of setting the scroll area of a spread sheet ie: using the
..scrollarea = function in VB where the scroll area may not be known at the
time of writing the vb code.

Instead of using activesheet.scrollarea = "a1:p34"

I want to use activesheet.scrollarea = range1 : where range1 has been
determined

Can this be done?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Scroll Area

instead use:
ActiveSheet.ScrollArea = "range1"
and to remove
ActiveSheet.ScrollArea = ""
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Ashman" wrote in message ...
Is there any way of setting the scroll area of a spread sheet ie: using the
.scrollarea = function in VB where the scroll area may not be known at the
time of writing the vb code.

Instead of using activesheet.scrollarea = "a1:p34"

I want to use activesheet.scrollarea = range1 : where range1 has been
determined

Can this be done?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Scroll Area

Hi Ashman

You can use this

Set rng = Range("A4:E10")
ActiveSheet.ScrollArea = rng.Address

Or

Set rng = Range("A1").CurrentRegion
ActiveSheet.ScrollArea = rng.Address


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ashman" wrote in message ...
Is there any way of setting the scroll area of a spread sheet ie: using the
.scrollarea = function in VB where the scroll area may not be known at the
time of writing the vb code.

Instead of using activesheet.scrollarea = "a1:p34"

I want to use activesheet.scrollarea = range1 : where range1 has been
determined

Can this be done?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Scroll Area

A better example: This will toggle between range1 as scroll area
and removing the scroll area limitations on mouse, arrow keys, scrolling, etc.

Private Sub Worksheet_BeforeRightClick(ByVal Target _
As Range, Cancel As Boolean)
Cancel = True
If ActiveSheet.ScrollArea = "" Then
ActiveSheet.ScrollArea = "range1"
Else
ActiveSheet.ScrollArea = ""
End If
End Sub

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Restricting Scroll Area Steve Jones Excel Discussion (Misc queries) 2 June 21st 06 01:19 PM
Scroll Area Paul Dusterhoft Excel Discussion (Misc queries) 8 September 21st 05 11:36 AM
Worksheet scroll area Steve Jones Excel Discussion (Misc queries) 3 April 22nd 05 12:07 PM
how to set scroll area David W[_3_] Excel Programming 1 August 26th 03 04:56 PM
Scroll Area for Data Ron de Bruin Excel Programming 0 July 25th 03 04:11 PM


All times are GMT +1. The time now is 09:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"