Results 1 to 2 of 2

Challenge: Moving a shape down/up on a scroll event

Threaded View

  1. #1
    Registered User
    Join Date
    08-24-2012
    Location
    Pretoria, South Africa
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    1

    Cool Challenge: Moving a shape down/up on a scroll event

    Hi all

    I'm new to this, but apart from that, this is what I'm trying to accomplish:

    I want to create a legend (or something similar) that moves to stay in the right hand corner of an excel document while you scroll up and down on the worksheet.
    This will make my work (as an auditor) much easier and also make my working papers look better.

    I've been playing around a bit and this is what I've done thus far:

    Sub ShapeDown()
        ActiveSheet.Shapes("Rectangle 3").Select
        On Error Resume Next
        With ActiveWindow.Selection.ShapeRange(1)
            .Top = .Top + .TopLeftCell.Offset(1).Height
        End With
        ActiveSheet.Range("C3").Select
    End Sub
    
    Sub ResetShape()
        ActiveSheet.Shapes("Rectangle 3").Select
        ActiveWindow.Selection.ShapeRange(1).Top = 12.75
        ActiveSheet.Range("C3").Select
    End Sub
    I didn't know if a worksheet change event or a scroll event would be the best for scrolling down and in a perfect world the macro should determine the width of the screen and position the shape in the top right corner of the page. The shape should then move to stay in that position as you read through the excel document. I do not want to freeze panes as I want to utilize the total height of the available screen.

    I am also open to suggestions.

    Thank you guys in advance.
    Last edited by Cutter; 08-24-2012 at 11:21 AM. Reason: Added code tags

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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