+ Reply to Thread
Results 1 to 4 of 4

Dynamic scroll area

  1. #1
    Registered User
    Join Date
    02-18-2006
    Posts
    4

    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

  2. #2
    Don Guillett
    Guest

    Re: 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
    [email protected]
    "Noslien" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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
    >




  3. #3
    Ardus Petus
    Guest

    Re: Dynamic scroll area


    "Noslien" <[email protected]> a écrit
    dans le message de
    news:[email protected]...
    >
    > 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



  4. #4
    Registered User
    Join Date
    02-18-2006
    Posts
    4
    Many thanks for the help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1