title: Copying cell value to textbox vba
body: <p>I have been trying to write a macro that will dynamically fill a textbox on a new sheet will the value of a cell from another sheet.</p>
  
  <p>I have managed to get it working using this:</p>
  
  <pre><code>Sub copyDetail()
  
  ' Define variables
  
  Dim pre As Worksheet
  Dim des As Worksheet
  
  Set pre = Sheets("Presentation")
  Set des = Sheets("Description")
  
  Dim i As Integer
  Dim lbl As String
  
  ' Scroll through labels and copy where boolean = 1
  
  For i = 2 To 17
      If des.Cells(i, 2) = 1 Then
          lbl = des.Cells(i, 11)
          Sheets("Presentation").Select
          ActiveSheet.Shapes.Range(Array("TextBox 1")).Select
          Selection.Text = lbl
  
      Else
  
      End If
  Next i
  
  End Sub
  </code></pre>
  
  <p>I basically want to be able to do exactly what this does but without using select all the time as this changes sheets and slows down my code (I have many other sub's to run alongside this one). I've tried things like defining the textbox using this:</p>
  
  <pre><code>Dim myLabel As Object
  Set myLabel = pre.Shapes.Range(Array("TextBox 1"))
  </code></pre>
  
  <p>But then I get an "object doesn't support this property or method" error when I try and call:</p>
  
  <pre><code>myLabel.Text = lbl
  </code></pre>