+ Reply to Thread
Results 1 to 4 of 4

Macro To Scroll Worksheet Automatically ?

  1. #1
    Registered User
    Join Date
    05-26-2004
    Posts
    18

    Macro To Scroll Worksheet Automatically ?

    Is it possible to scroll a worksheet automatically at a speed of my choosing ? Hitting the scroll arrow moves it too quickly and using the mouse wheel slowly going thru 10000 cells will make me insane. I'd like to be able to use a speed which gives me just a split second to comprehend what is in the cell and then for the worksheet to scroll to next cell. I figure three cells a second scroll speed would be about right.
    As always, thanks for the help.

  2. #2
    Tom Ogilvy
    Guest

    Re: Macro To Scroll Worksheet Automatically ?

    Declare Sub Sleep Lib "kernel32.dll" ( _
    ByVal dwMilliseconds As Long)
    Const DELAY = 150&
    Sub Scroll()
    Set rng = ActiveWindow.VisibleRange
    For i = 1 To 5
    ActiveCell.Offset(rng.Rows.Count - 1, 1).Select
    Sleep DELAY
    Next i
    End Sub

    Change the value of DELAY to meet your needs.

    --
    Regards,
    Tom Ogilvy

    "brazen234" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Is it possible to scroll a worksheet automatically at a speed of my
    > choosing ? Hitting the scroll arrow moves it too quickly and using the
    > mouse wheel slowly going thru 10000 cells will make me insane. I'd like
    > to be able to use a speed which gives me just a split second to
    > comprehend what is in the cell and then for the worksheet to scroll to
    > next cell. I figure three cells a second scroll speed would be about
    > right.
    > As always, thanks for the help.
    >
    >
    > --
    > brazen234
    > ------------------------------------------------------------------------
    > brazen234's Profile:

    http://www.excelforum.com/member.php...fo&userid=9952
    > View this thread: http://www.excelforum.com/showthread...hreadid=499366
    >




  3. #3
    Registered User
    Join Date
    05-26-2004
    Posts
    18
    Thanks for your input Tom. I ran the macro and it scrolled columns and also each column scroll it jumped 55 rows so that by the end of the macro the selected cell was F271. So I tinkered around and messed with the numbers and by changing the "Rng.Rows.Count" to "54,0" I was able to get the scroll to be rows down column A only.

    Declare Sub Sleep Lib "kernel32.dll" ( _
    ByVal dwMilliseconds As Long)
    Const DELAY = 500&
    Sub Scroll()
    Set Rng = ActiveWindow.VisibleRange
    For i = 1 To 100
    ActiveCell.Offset(Rng.Rows.Count - 54, 0).Select
    Sleep DELAY
    Next i
    End Sub

    Altough this worked well on a non-filtered worksheet, it seams to be skipping many cells on filtered selections. If you know what can be done about this let me know. I'll probably be messing around with the numbers to see what can be done.

  4. #4
    Tom Ogilvy
    Guest

    Re: Macro To Scroll Worksheet Automatically ?

    Try something like this

    Declare Sub Sleep Lib "kernel32.dll" ( _
    ByVal dwMilliseconds As Long)
    Const DELAY = 50&
    Sub Scroll()
    For i = 1 To 10
    Set rng = ActiveWindow.VisibleRange.Columns(1).Cells
    Set rng = rng.SpecialCells(xlVisible)
    Set rng1 = rng.Areas(rng.Areas.Count)
    If rng1.Count = 1 Then _
    Set rng1 = rng.Areas(rng.Areas.Count - 1)
    rng1(rng1.Count).Select
    ActiveWindow.ScrollRow = rng1.Row
    Debug.Print rng1(rng1.Count).Address
    Sleep DELAY
    Next i
    End Sub

    --
    Regards,
    Tom Ogilvy



    "brazen234" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Thanks for your input Tom. I ran the macro and it scrolled columns and
    > also each column scroll it jumped 55 rows so that by the end of the
    > macro the selected cell was F271. So I tinkered around and messed with
    > the numbers and by changing the "Rng.Rows.Count" to "54,0" I was able
    > to get the scroll to be rows down column A only.
    >
    > Declare Sub Sleep Lib "kernel32.dll" ( _
    > ByVal dwMilliseconds As Long)
    > Const DELAY = 500&
    > Sub Scroll()
    > Set Rng = ActiveWindow.VisibleRange
    > For i = 1 To 100
    > ActiveCell.Offset(Rng.Rows.Count - 54, 0).Select
    > Sleep DELAY
    > Next i
    > End Sub
    >
    > Altough this worked well on a non-filtered worksheet, it seams to be
    > skipping many cells on filtered selections. If you know what can be
    > done about this let me know. I'll probably be messing around with the
    > numbers to see what can be done.
    >
    >
    > --
    > brazen234
    > ------------------------------------------------------------------------
    > brazen234's Profile:

    http://www.excelforum.com/member.php...fo&userid=9952
    > View this thread: http://www.excelforum.com/showthread...hreadid=499366
    >




+ 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