PDA

View Full Version : how to rotate a "Curved Down Arrow" till reach next command



elsuji
05-06-2020, 12:00 PM
Dear Team,

I wrote code for rotating Curved Down Arrow shape. When ActivePresentation.Slides(4).Shapes("MIXER ON/OFF").TextFrame.TextRange.Text = "ON" then it start rotating.

My code is here


' Minimum & maximum angles in degrees Const MinAngle& = 0, MaxAngle& = 360
' Define the rotation ratio from 0 up to 1
Dim phi&, Ratio#, t!


' Rotate shape
With ActivePresentation.Slides(4).Shapes(ShpArrRot(x))


' Rotate clockwise
For Ratio = 0.5 To 5 Step 0.01
' Calc the rotation angle in degrees
If ActivePresentation.Slides(4).Shapes("MIXER ON/OFF").TextFrame.TextRange.Text = "ON" Then
phi = MinAngle + (MaxAngle - MinAngle) * Ratio
' Rotate shape
.Rotation = phi
' Make pause
t = Timer + 0.01: While Timer < t: DoEvents: Wend
Else
Exit Sub
End If
Next


End With

When i am executing my code it rotating 5 times only.

But i want it should rotate till change ActivePresentation.Slides(4).Shapes("MIXER ON/OFF").TextFrame.TextRange.Text = "OFF"

Can any one explain me how to change my code according to my requirement