Mega Code Archive

 
Categories / VisualBasic Script / Excel
 

Zooms in on a left mouse click and zooms out on a right mouse click

Private Sub MyChartClass_MouseDown(ByVal Button As Long, ByVal Shift _     As Long, ByVal x As Long, ByVal y As Long)     If Button = 1 Then         ActiveChart.Axes(xlValue).MaximumScale = ActiveChart.Axes(xlValue).MaximumScale - 50     End If     If Button = 2 Then        ActiveChart.Axes(xlValue).MaximumScale = ActiveChart.Axes(xlValue).MaximumScale + 50     End If End Sub