title: Inserting values from a UserForm to excel sheet which start from a fixed cell?
body: <p>I have a Cell range <code>Sheets(&quot;INVOICE MAKER&quot;).Range(&quot;D18:D37&quot;)</code> (Total 20 Cells), and a little <strong>UserForm</strong> with name <strong>Add Items</strong>.</p>
  <p>In <strong>UserForm</strong> there are one <strong>Textbox</strong> and one <strong>Submit Button</strong>.</p>
  <p>So if I write something in that <strong>Textbox</strong> and click on <strong>Submit Button</strong>, Data should be write to next available empty cell in range <code>Sheets(&quot;INVOICE MAKER&quot;).Range(&quot;D18:D37&quot;)</code>. And if all 20 cells are filled with data then show a message like <strong>&quot;No more rows are available to write data&quot;</strong>.</p>
  <p>Below code don't start writing data from <strong><code>Cell D18</code></strong>, its start writing data from <strong><code>D1</code></strong>.
  and doesn't stop after cell <code>D37</code>.</p>
  <pre><code>Option Explicit
  Dim lRow As Long
  Dim ws As Worksheet
  Set ws = Worksheets(&quot;INVOICE MAKER&quot;)
  
  lRow = ws.Cells.Find(What:=&quot;*&quot;, SearchOrder:=xlRows, _
      SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
      
  'check for a part number
  If Trim(Me.Textbox.Value) = &quot;&quot; Then
    Me.Textbox.SetFocus
    MsgBox &quot;Please Type Item Name&quot;
    Exit Sub
  End If
  
  With ws
    .Cells(lRow, 5).Value = Me.Textbox.Value
  End With
  
  End Sub
  </code></pre>