Hi,
Would anyone know why below is not working ? i get a debug error !
Thanks
Would anyone know why below is not working ? i get a debug error !
Thanks
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)Dim previousRow As Long
Dim vOffset As Double
Dim currentRow As Long
currentRow = Me.Application.ActiveWindow.ScrollRow
If previousRow <> currentRow Then
If previousRow = 0 Then
previousRow = Me.Application.ActiveWindow.ScrollRow
End If
'reposition charts
For Each c In ActiveSheet.ChartObjects
vOffset = c.Top – Me.Rows(previousRow).Top
c.Top = Me.Rows(currentRow).Top + vOffset
Next c
previousRow = currentRow
End If
End Sub