title: How can I input data to excel from inputting data in text box where the text box are from two or more Userform Using Excel VB?
body: <p>I am trying to ease the data entry from financial report, so i try to make forms using Excel Visual Basic.</p>
  
  <p>I made 2 Userform so far ,later i will made 5. I made userform so the data entry operator can have simple design of the form, because the textboxs are so many,then I partitioned the sector into 5 userform to simplifiy it.</p>
  
  <p>To move between Sector, the operator can jump to another userform using command button. </p>
  
  <p>When the operator has finished the data entry from all 3 userform, he will comeback to the main Userform to Entry the data all at once into excel. </p>
  
  <p>My problem is, i find it difficult to connect between userform to take the value from each userform so that finally the value can be inputted to excel all at once using 1 command button at the main userform or userform1.</p>
  
  <p>My code for the command button is this:</p>
  
  <pre><code>Private Sub cmdAddData_Click()
   'Copy input values to sheet.
  Dim lRow As Long
  Dim ws As Worksheet
  Set ws = Worksheets("Summary")
  lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
  With ws
      .Cells(lRow, 1).Value = Me.txtNo.Value
      .Cells(lRow, 2).Value = Me.txtKode.Value
      .Cells(lRow, 3).Value = Me.txtNamaPerusahaan.Value
      .Cells(lRow, 4).Value = Me.txtSector.Value
      .Cells(lRow, 5).Value = Me.txtTime.Value
      'UserForm2Begin'
      .Cells(lRow, 7).Value = Me.txtKas.Value
      .Cells(lRow, 8).Value = Me.txtInvestasi.Value
      .Cells(lRow, 9).Value = Me.txtDanaTerbatas.Value
      .Cells(lRow, 10).Value = Me.txtPiutangUsaha.Value
      'UserForm2End'
    End With
  
  'Clear input controls.
  Me.txtNo.Value = ""
  Me.txtKode.Value = ""
  Me.txtNamaPerusahaan.Value = ""
  Me.txtSector.Value = ""
  Me.txtTime.Value = ""
  'Userform2Begin'
  Me.txtKas.Value = ""
  Me.txtInvestasi.Value = ""
  Me.txtDanaTerbatas.Value = ""
  Me.txtPiutangUsaha.Value = ""
  'Userform2End'
  </code></pre>
  
  <p>Thanks in advance</p>