title: Excel-VBA How to know which dynamically created UserForm TextBox has changed?
body: <p>I have an excel UserForm that creates textboxes during execution time. code as follows;</p>
  
  <pre><code>Dim CompHandler() As New CCompHandler
  Dim tb As MSForms.TextBox   
  Dim count As Integer
  For i in Range(something)
      If i = anotherthing Then
          Set tb = UserForm1.Controls.Add("Forms.TextBox.1", "tb" &amp; count)
          With tb
              .Width = iTbWidth
              .Top = count * distance
              .Left = iTbLeft
              .Height = iTbHeight
              .Value = Cells(row, column)
              ReDim Preserve CompHandler(0 To count)
              Set CompHandler(count).TextBoxGroup = tb
          End With
      count = count + 1
      End If
  Next i
  </code></pre>
  
  <p>I want to write back the changed value to the corresponding cell.
  I'm already able to get when the box has changed and the new value with this code on a <code>class called CCompHandler</code>:</p>
  
  <pre><code>Option Explicit
  
  Public WithEvents TextBoxGroup As MSForms.TextBox
  
  Private Sub TextBoxGroup_Change()
  
      MsgBox TextBoxGroup
  
  End Sub
  </code></pre>
  
  <p>So.. any ideas on how can I get which textbox has changed?
  Or maybe is there a better way of doing that?
  Thanks in advance</p>