title: inserting row(s) from the selected value
body: <p>I have 2 columns A and B. </p>
  
  <pre><code>A = 12 (months)
  B = 12.000.000
  C (result) = B/A = 12.000.000 / 12 = 1.000.000
  </code></pre>
  
  <p>The result that I want will be looping automatically insert new row(s) based on months (A)</p>
  
  <pre><code>month     amount
  1        1.000.000
  2        1.000.000
  3        1.000.000
  4        1.000.000
  5        1.000.000
  6        1.000.000
  .
  .
  .
  12       1.000.000
  </code></pre>
  
  <p>this is my complete code while adding in my case :</p>
  
  <pre><code>Private Sub cmdAdd_Click()
  Dim lRow As Long
  Dim lPart As Long
  Dim ws As Worksheet
  Set ws = Worksheets("PostBudgetData")
  
  lRow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _
      SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
  
  lPart = Me.cboMonth.ListIndex
      If CheckBox1.Value = True Then
      If Trim(Me.cboMonth.Value) = "" Then
          Me.cboMonth.SetFocus
          MsgBox "Please enter a part number"
      Exit Sub
      End If
  End If
  
  
  
  'copy the data to the database
  With ws
    .Cells(lRow, 1).Value = Me.cboYear.Value
  If CheckBox1.Value = True Then
        .Cells(lRow, 2).Value = Me.cboMonth.List(lPart, 0)
  End If
    .Cells(lRow, 3).Value = Me.cboBrand.Value
    .Cells(lRow, 4).Value = Me.cboPostBudget.Value
    .Cells(lRow, 5).Value = Me.cboArea.Value
    .Cells(lRow, 6).Value = Me.txtValue.Value
    .Cells(lRow, 7).Value = Me.cboSBU.Value
  End With
  
  'clear the data
  Me.cboMonth.Value = ""
  Me.cboYear.Value = ""
  Me.cboBrand.Value = ""
  Me.cboPostBudget.Value = ""
  Me.cboArea.Value = ""
  Me.cboSBU.Value = ""
  
  'Me.txtValue.Value = Format(Date, "Medium Date")
  Me.txtValue.Value = 0
  
  If CheckBox1.Value = True Then
        Me.cboMonth.SetFocus
  End If
  
  End Sub
  </code></pre>
  
  <p>But it is not looping. I don't know to loop in vba while inserting new row(s) cos it just insert 1 row. This is what i tried not just I'm tired and asking without do anything. </p>