title: Drawing Rectagles On Excel, Entire Row, "Run-time error :'1004'"
body: <p>I simplified my code:</p>
  
  <p>I want to draw two Rectangles:
  The First to Left Side of The Selected Cell (the code is not intented for First "A" Column)
  The Second to Right Side Of Selected Cell (the code is not intented for Last "XFD" Column).</p>
  
  <p>Function to be used by both code.</p>
  
  <pre><code>    Private Function NumToCol(numCol)
          NumToCol = Split(Cells(, numCol).Address, "$")(1)
      End Function
  </code></pre>
  
  <p>Here my code:</p>
  
  <pre><code>    Sub CreateLateralRectangles()
          'Working no problem
  
          Dim LftRctl As Shape
          Dim RhtRctl As Shape
          Dim RngRht As Range
          Dim RngLft As Range
  
          MyRow = ActiveCell.Row
          MyCol = ActiveCell.Column
  
          LftCol = MyCol - 1
          RgtCol = MyCol + 1
  
          LRng = NumToCol(LftCol - 3) &amp; MyRow &amp; ":" &amp; NumToCol(LftCol) &amp; MyRow
          RRng = NumToCol(RgtCol) &amp; MyRow &amp; ":" &amp; NumToCol(RgtCol + 3) &amp; MyRow
  
          Set RngRht = Range(RRng)
          Set RngLft = Range(LRng)
  
          MsgBox "Beging To Create"
          Set LftRctl = ActiveSheet.Shapes.AddShape(msoShapeRectangle, RngLft.Left, RngLft.Top, RngLft.Width, RngLft.Height)
          Set RhtRctl = ActiveSheet.Shapes.AddShape(msoShapeRectangle, RngRht.Left, RngRht.Top, RngRht.Width, RngRht.Height)
      End Sub
  </code></pre>
  
  <p>The next code presents "Run-time error :'1004'"  "Application-defined or object-defined error"</p>
  
  <pre><code>    Sub CreateFullRectangles()
          'Has problem
  
          Dim LftRctl As Shape
          Dim RhtRctl As Shape
          Dim RngRht As Range
          Dim RngLft As Range
  
          MyRow = ActiveCell.Row
          MyCol = ActiveCell.Column
  
          LftCol = MyCol - 1
          RgtCol = MyCol + 1
  
          LRng = "A" &amp; MyRow &amp; ":" &amp; NumToCol(LftCol) &amp; MyRow
          RRng = NumToCol(RgtCol) &amp; MyRow &amp; ":" &amp; "XFD" &amp; MyRow
  
          Set RngRht = Range(RRng)
          Set RngLft = Range(LRng)
  
          MsgBox "Beging To Create"
          Set LftRctl = ActiveSheet.Shapes.AddShape(msoShapeRectangle, RngLft.Left, RngLft.Top, RngLft.Width, RngLft.Height)
          Set RhtRctl = ActiveSheet.Shapes.AddShape(msoShapeRectangle, RngRht.Left, RngRht.Top, RngRht.Width, RngRht.Height)
      End Sub
  </code></pre>
  
  <p>But I can't figure out what's is the real error On second code:</p>