title: The ShapeRange Object must contain at least two items
body: <p>When I run this code I get the following error: Run-time error: The ShapeRange Object must contain at least two items.</p>
  <pre><code>For i = 1 To counter
  
      x = Range(&quot;mainPositions&quot;).Item(i, 1)
      y = Range(&quot;mainPositions&quot;).Item(i, 2)
      nameX = Range(&quot;mainPositions&quot;).Item(i, 3)
  
      textX = Range(&quot;mainPositions&quot;).Item(i, 4)
          ActiveSheet.Shapes.AddShape(txtboxShape, x * hDistance + startX, y * vDistance + startY, txtboxWidth, txtboxHeight).Select
  
      Selection.ShapeRange(1).TextFrame2.TextRange.Characters.Text = textX
      Selection.ShapeRange.Name = nameX
      Call styleShape(CStr(nameX))
      If x * hDistance + startX + txtboxWidth &gt; maxX Then
          maxX = x * hDistance + startX + txtboxWidth
      End If
      If y * vDistance + startY + txtboxHeight &gt; maxY Then
          maxY = y * vDistance + startY + txtboxHeight
      End If
  Next i
  </code></pre>