title: Offset rows into a range - Vba
body: <p>anything I can do to help shorten this code?</p>
  
  <pre><code>Dim iRow As Long
  Dim Lastrow As Long
  Dim ws As Worksheet
  Set ws = Worksheets("FirstShift")
  
  Lastrow = ws.Range("c:v").Find("*", , , , xlByRows, xlPrevious).Row
  
  'This code here:
  
   For iRow = 16 To Lastrow
   If ws.Cells(iRow, 9).Value = "" And ws.Cells(iRow, 9).Offset(0, 1).Value = 
   "" And ws.Cells(iRow, 9).Offset(0, 2).Value = "" And ws.Cells(iRow, 
   9).Offset(0, 3).Value = "" And ws.Cells(iRow, 9).Offset(0, 4).Value = "" 
   And ws.Cells(iRow, 9).Offset(0, 5).Value = "" And ws.Cells(iRow, 
   9).Offset(0, 6).Value = "" And ws.Cells(iRow, 9).Offset(0, 7).Value = "" 
   And ws.Cells(iRow, 9).Offset(0, 8).Value = "" And ws.Cells(iRow, 
   9).Offset(0, 9).Value = "" And ws.Cells(iRow, 9).Offset(0, 10).Value = "" 
   Then
      ws.Cells(iRow, 9).Value = Me.textbox_Lane1.Value
   End If
  Next iRow
  
  For iRow = 16 To Lastrow
  If ws.Cells(iRow, 10).Value = "" And ws.Cells(iRow, 10).Offset(0, 1).Value 
  = "" And ws.Cells(iRow, 10).Offset(0, 2).Value = "" And ws.Cells(iRow, 
  10).Offset(0, 3).Value = "" And ws.Cells(iRow, 10).Offset(0, 4).Value = "" 
  And ws.Cells(iRow, 10).Offset(0, 5).Value = "" And ws.Cells(iRow, 
  10).Offset(0, 6).Value = "" And ws.Cells(iRow, 10).Offset(0, 7).Value = "" 
  And ws.Cells(iRow, 10).Offset(0, 8).Value = "" And ws.Cells(iRow, 
  10).Offset(0, 9).Value = "" And ws.Cells(iRow, 10).Offset(0, -1).Value = "" 
  Then
     ws.Cells(iRow, 10).Value = Me.textbox_Lane2.Value
  End If
  Next iRow
  
  'To here...
  </code></pre>
  
  <p>I have 11 data cells in which I need to keep them in a line or row when the data is entered. The challenge is that sometimes not all 11 data cells will have data so in order for me to keep each data input in a line or row, this is the code I came up which works. </p>
  
  <p>Now I have a few more data cells to add and this code is just getting way too long and ridiculous. Help is appreciated! Thanks!</p>