Share via

Visual Basic

Offermans, Paul 1 Reputation point
2022-08-19T07:29:36.13+00:00

I downloaded Visual Basic scripts. Aim is to enlarge part of the XYgraph (zoom). This is done by drawing a rectangle with the mouse. The selection becomes the the new axes.
However in my version this selection doesnot work.
Here a piece of the code.

Private Sub Chart_MouseDown(ByVal Button As Long, ByVal Shift As Long, ByVal x As Long, ByVal y As Long)

If Not ZoomEnabled Then  
    Exit Sub  
End If  
  
Application.CommandBars("Drawing").Controls("Rectangle").Execute  

End Sub

** Since I cannot draw a rectangle,

What could be the solution? Ican send the excel work file if sombebody is interested.

Thanks in advance Paul

Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.