title: How can I move a shape so its centre lines up with a cell left edge in excel VBA
body: <p>I have a group of shapes and I can currently move it to the top left edge of a reference cell however I need the middle of the shape to line up with this left edge. There is only "Top" and "Left" parameters and no "Middle" is there any way of doing this?</p>
  
  <p>I could move to left edge then increment by x amount based on the column width but this seems long winded?</p>
  
  <pre><code>Sub Macro4()
  
  Dim x
  Set x = Range("A2")
  
  Sheet1.Shapes("Group 9").Left = Sheet1.Cells(13, x).Left
  Sheet1.Shapes("Group 9").Top = Sheet1.Cells(13, x).Top
  
  
  End Sub
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>My code is now as follows:</p>
  
  <p>With Sheet1</p>
  
  <pre><code>    .Shapes("Group 9").Top = rng.Top
      .Shapes("Group 9").Left = rng.Left - (.Shapes("Group 9").Width / 2) + (rng.Width / 2)
  
  
  End With
  </code></pre>
  
  <p>Which achieves the following</p>
  
  <p><a href="https://i.stack.imgur.com/Dh9mj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Dh9mj.png" alt="enter image description here"></a></p>
  
  <p>However I need to achieve this:</p>
  
  <p><a href="https://i.stack.imgur.com/Plbnt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Plbnt.png" alt="enter image description here"></a></p>
  
  <p>Whereby the inputed date in red means the shape centre aligns to the right edge of the cell in row 11 which matches the date in this case R11</p>