ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dynamic scroll area (https://www.excelbanter.com/excel-programming/353707-dynamic-scroll-area.html)

Noslien

Dynamic scroll area
 

I want to be able to change the size of the scroll area on a work sheet
when I run a macro. The problem is that the format for doing this is

Worksheets("Sheet2").ScrollArea = "A1:B2"

where "A1:B2" has to be a string, however i will be calculating the
range in the VB macro so it will be in the form of
Ranges(cells(a,b),cells(x,y)) - where a,b,x & y are calculated - and
this is not a string. How can I solve this??

Grateful for any help


--
Noslien
------------------------------------------------------------------------
Noslien's Profile: http://www.excelforum.com/member.php...o&userid=31701
View this thread: http://www.excelforum.com/showthread...hreadid=514035


Don Guillett

Dynamic scroll area
 
use this idea for this AND you can use for printarea as well

Sub setscrollareabyaddress()
Set myscrollarea = Range(Cells(1, 1), Cells(5, 12))
Worksheets("Sheet7").ScrollArea = myscrollarea.Address '"A1:B2"

End Sub

--
Don Guillett
SalesAid Software

"Noslien" wrote in
message ...

I want to be able to change the size of the scroll area on a work sheet
when I run a macro. The problem is that the format for doing this is

Worksheets("Sheet2").ScrollArea = "A1:B2"

where "A1:B2" has to be a string, however i will be calculating the
range in the VB macro so it will be in the form of
Ranges(cells(a,b),cells(x,y)) - where a,b,x & y are calculated - and
this is not a string. How can I solve this??

Grateful for any help


--
Noslien
------------------------------------------------------------------------
Noslien's Profile:
http://www.excelforum.com/member.php...o&userid=31701
View this thread: http://www.excelforum.com/showthread...hreadid=514035




Ardus Petus

Dynamic scroll area
 

"Noslien" a écrit
dans le message de
...

I want to be able to change the size of the scroll area on a work sheet
when I run a macro. The problem is that the format for doing this is

Worksheets("Sheet2").ScrollArea = "A1:B2"

where "A1:B2" has to be a string, however i will be calculating the
range in the VB macro so it will be in the form of
Ranges(cells(a,b),cells(x,y)) - where a,b,x & y are calculated - and
this is not a string. How can I solve this??

Grateful for any help


--
Noslien
------------------------------------------------------------------------
Noslien's Profile:

http://www.excelforum.com/member.php...o&userid=31701
View this thread: http://www.excelforum.com/showthread...hreadid=514035

Worksheets("Sheet2").ScrollArea = Range(cells(a,b),cells(x,y)).Address

HTH
--
AP



Noslien[_2_]

Dynamic scroll area
 

Many thanks for the help


--
Noslien
------------------------------------------------------------------------
Noslien's Profile: http://www.excelforum.com/member.php...o&userid=31701
View this thread: http://www.excelforum.com/showthread...hreadid=514035



All times are GMT +1. The time now is 02:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com