title: Capture cell value with TextBox in UserForm
body: <p>I have a UserForm which should be able to copy paste cells ideally. So firstly I would click the range I would want to copy, then activate the UserForm. The UserForm would have a combo box to choose which sheet I want to paste the data in, thereafter it would go to that sheet and user will click on the range or cell where he wants the data to be pasted.  </p>
  
  <p>I originally did an input box code to do this and it works perfectly, however when I do it in the UserForm it does not work as I am not able to incorporate the <code>Type:=8</code> code in the textbox.  Hence I would need some help on how can I enable my UserForm to paste cell data on the sheet, similarly to what I have done in <code>application.inputbox</code>.</p>
  
  <p>This is the perfectly working code in the form of an input box: </p>
  
  <pre><code>Sub CopyPasteCumUpdateWithinSameSheet()
  
  
  Dim rng As Range
  Dim inp As Range
  
  Selection.Interior.ColorIndex = 37
  Set inp = Selection
  On Error Resume Next
  Set rng = Application.InputBox("Copy to", Type:=8)
   On Error GoTo 0
      If TypeName(rng) &lt;&gt; "Range" Then
          Exit Sub
      Else
  inp.Copy
  
  rng.Select
  
  ActiveSheet.Paste Link:=True
  
  'Cells(1,2).Font.ThemeColor =
  
  End If
  
  End Sub
  </code></pre>
  
  <p>This is the UserForm I have tried:</p>
  
  <pre><code>Dim Sh As Worksheet
  
  Private Sub CommandButton1_Click()
  On Error GoTo 0
      If TypeName(rng) &lt;&gt; "Range" Then
          Exit Sub
      Else
  inp.Copy
  
  rng.Select
  
  ActiveSheet.Paste Link:=True
  End If
  
  End Sub
  
  Private Sub UserForm_Initialize()
  
  CopyPasteUserform.Show vbModeless
      For Each Sh In ThisWorkbook.Sheets
          If Sh.Name &lt;&gt; "Inputs" Then
              ComboBox1.AddItem Sh.Name
          End If
      Next
  
      ComboBox1.Style = fmStyleDropDownList
  End Sub
  
  
  
  Private Sub ComboBox1_Change()
  With ThisWorkbook.Sheets(ComboBox1.Text)
          .Visible = xlSheetVisible
          .Activate
      End With
  
  
  End Sub
  
  Private Sub TextBox1_Change()
  
  
  
  Dim rng As Range
  Dim inp As Range
  
  Selection.Interior.ColorIndex = 37
  Set inp = Selection
  On Error Resume Next
  Set rng = TextBox.Value
  
  
  
  
  End Sub
  </code></pre>
  
  <p>I tried incorporating the UserForm but all other functions stop responding apart from the RefEdit.</p>
  
  <pre><code>Dim Sh As Worksheet
  
  
  Private Sub UserForm_Initialize()
  
  CopyPasteUserform.Show vbModeless
      For Each Sh In ThisWorkbook.Sheets
          If Sh.Name &lt;&gt; "Inputs" Then
              ComboBox1.AddItem Sh.Name
          End If
      Next
  
      ComboBox1.Style = fmStyleDropDownList
  
  Dim rng As Range
  Dim inp As Range
  
  Selection.Interior.ColorIndex = 37
  Set inp = Selection
  End Sub
  
  
  
  Private Sub Combobox1_Change()
  With ThisWorkbook.Sheets(ComboBox1.Text)
          .Visible = xlSheetVisible
          .Activate
      End With
  
  
  End Sub
  
  Private Sub RefEdit1_Change()
      Label1.Caption = ""
  
      If RefEdit1.Value &lt;&gt; "" Then _
      Label1.Caption = "[" &amp; ComboBox1 &amp; "]" &amp; RefEdit1
      Dim rng As Range
  Dim inp As Range
  
  
  On Error Resume Next
  Set rng = RefEdit1.Value
   On Error GoTo 0
      If TypeName(rng) &lt;&gt; "Range" Then
          Exit Sub
      Else
  inp.Copy
  
  rng.Select
  
  ActiveSheet.Paste Link:=True
  
  End If
  
  End Sub
  </code></pre>