title: Excel 2010 VBA macro adjust to do all rows 1-by-1 down to the last row (14000 rows)
body: <p>Right now the macro does the following:
  1. Selects entire row. 2. Sorts sideways (left to right). 3. Goes to the next row. (And is ready for me to do Ctrl+s and make it run again on the next row. Which is exactly what I'm trying to avoid because I have to do 14000 rows).</p>
  
  <p>How do I modify the code to do the same thing all the way down from row 1, to row number 14000? (I don't want it to check row by row if there is some content because that'll slow down the code. I'd rather hard code the row number to 14000 right now, and then change it manually as needed).</p>
  
  <hr>
  
  <pre><code>Sub SortingOneByOne()
  '
  ' SortingOneByOne Macro
  '
  ' Keyboard Shortcut: Ctrl+s
  '
      ActiveCell.Rows("1:1").EntireRow.Select
      ActiveWorkbook.Worksheets("Sheet2").Sort.SortFields.Clear
      ActiveWorkbook.Worksheets("Sheet2").Sort.SortFields.Add Key:=ActiveCell.Range _
          ("A1:AEA1"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
          xlSortNormal
      With ActiveWorkbook.Worksheets("Sheet2").Sort
          .SetRange ActiveCell.Range("1:1")
          .Header = xlGuess
          .MatchCase = False
          .Orientation = xlLeftToRight
          .SortMethod = xlPinYin
          .Apply
      End With
      ActiveCell.Offset(1, 0).Rows("1:1").EntireRow.Select
  End Sub
  </code></pre>
  
  <hr>
  
  <p>I found this code which seems to do just that, but I don't know how to have the 2 codes work together:</p>
  
  <pre><code>Sub FindEmptyCell_2() 
  Dim i As Integer 
  Do 
  i = i + 1 
  Loop Until IsEmpty(Range("A1").Offset(i, 0).Value) 
  Range("A1").Offset(i, 0).Select 
  End Sub 
  </code></pre>