I am trying to use an activeX scroll bar to move a vertical line across a set of graphs in a worksheet. I have a code that will move the line forward with each click of the scroll bar, but can't get it to move backwards when the scroll bar value decreases.
I'm not sure if there is an easy way to do this, it's my first time working with activeX controls. Or if there's a way to store the linked cell's previous value to use as a reference?
using Excel 2007
Code:
Private Sub ScrollBar1_Change()
Dim slider As Integer
Scroll = Sheets("FormattedGraphs").Range("A49") 'value of cell linked to scroll bar
ActiveSheet.Shapes("Straight Connector 86").Select 'vertical line drawn on sheet
Selection.ShapeRange.IncrementLeft 1 * Scroll 'pixels to move with each scroll bar click
End Sub
I'm not sure if there is an easy way to do this, it's my first time working with activeX controls. Or if there's a way to store the linked cell's previous value to use as a reference?
using Excel 2007