Skip to content

How to Keep a Chart (or Charts) Visible when Scrolling in Excel?

     

    In this video tutorial I explain how to keep a chart visible when scrolling up or down through a worksheet.  I explore two methods:

    Click here to download the featured file (including code)

    Video Table of Contents

    00:00 – Introduction

    00:18 – METHOD 1: Freeze Panes

    00:49 – METHOD 2: VBA – see code below

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
    With ActiveWindow.VisibleRange
    
        ActiveSheet.ChartObjects("Chart 2").Top = .Top + 5
    
        ActiveSheet.ChartObjects("Chart 2").Left = .Left + 200
        
        ActiveSheet.ChartObjects("Chart 3").Top = .Top + 5
        'Use the code below to stack columns vertically (remove apostrophe & delete the line of code above)
        'ActiveSheet.ChartObjects("Chart 3").Top = ActiveSheet.ChartObjects("Chart 2").Height + .Top + 20
        
        ActiveSheet.ChartObjects("Chart 3").Left = .Left + 200
        'Use the code below to place charts side by side (remove apostrophe & delete the line of code above)
        'ActiveSheet.ChartObjects("Chart 3").Left = ActiveSheet.ChartObjects("Chart 2").Width + .Left + 225
        
        
    End With
    
    End Sub