title: Rotating Shapes when arranging them into circle ppt vba
body: <p>I found a great script to arrange objects (shapes) into a circle here:
  <a href="http://answers.microsoft.com/en-us/office/forum/office_2003-powerpoint/aligning-shapes-in-a-circle-using-vba/170632a9-427b-46c1-90ea-c0f7f8235863" rel="nofollow">Aligning Shapes in a Circle using VBA, Microsoft Community</a></p>
  
  <pre><code>Sub Test()
  Call AlignShapesInCircle(720 / 2, 540 / 2, 100, ActiveWindow.Selection.ShapeRange)
  End Sub
  Function AlignShapesInCircle(x As Single, y As Single, r As Single, shprng As ShapeRange)
  'x,y    = center point of the circle
  'r      = radius of the circle
  'shprng = the shape selection that needs to be arranged
  Dim angle As Single
  Dim currentangle As Single
  Dim x1 As Single
  Dim y1 As Single
  Dim i As Integer
  currentangle = 0
  angle = 360 / shprng.count
  For currentangle = 0 To 359 Step angle
      i = i + 1
      x1 = r * Cos(D2R(currentangle))
      y1 = r * Sin(D2R(currentangle))
      shprng(i).Left = x + x1
      shprng(i).Top = y + y1
  Next
  End Function
  Function D2R(Degrees) As Double
      D2R = Degrees / 57.2957795130823
  End Function
  
  Function R2D(Radians) As Double
      R2D = 57.2957795130823 * Radians
  End Function
  </code></pre>
  
  <p>Now I want the shapes to rotate so that if I use arrows the tip will always show towards the center. </p>
  
  <p>I have to introduce a line here:</p>
  
  <pre><code>shprng(i).Left = x + x1
  shprng(i).Top = y + y1
  shprng(i).Rotation = ???
  </code></pre>
  
  <p>Any ideas where I could find the proper formula?</p>