title: Creating a "database" with excel with VBA Userform
body: <pre><code>Private Sub CommandButton1_Click()
  
  Dim actual_sheet As String
  
  actual_sheet = "Sheet1"
  
  Dim data_base As Variant
  
  data_base = Sheets(actual_sheet).Range("G4:K100000")
  
  nome = TextBox1.Value
  Age = TextBox2.Value
  Adress = TextBox3.Value
  Phone = TextBox4.Value
  
  For i = 1 To UBound(data_base)
  
      Line_at = data_base(i, 1)
  
      If Line_at = "" Then
  
          ' id
          data_base(i, 1) = i
          'name
          data_base(i, 2) = nome
          'age
          data_base(i, 3) = Age
          'adress
          data_base(i, 4) = Adress
          'phone
          data_base(i, 5) = Phone
  
          Exit For
  
      End If
  
  Next
  
  
  Sheets(actual_sheet).Range("G4:K100000") = database
  
  UserNew.Hide
  
  
  
  End Sub
  </code></pre>
  
  <p>I have a form for a user called <code>UserNew</code> and I want some information to a 'database' *just a table for exercise * , but when i click the CommandButton_1 nothing happens to my "data_base", i debugged and i saw that the values are actually getting passed, but i think the problem it's with the writting part ... I don't know is not working ....
  Any help is appreciated.
  <br>
  Actually i can pass the values to a sub(name,age,address,phone) , but there's a way to this automatically like this example ?</p>