title: Select multiple rows in excel based on last row
body: <p>I have a piece of code which selects the entire row from my table based on the last data in column K. E.g. if I have rows 5 to 10 populated, it will select row 10.</p>
  
  <p>How do I get the code to select multiple rows from row 5 all the way to the last row as defined below?</p>
  
  <p>Thanks</p>
  
  <pre><code>Sub selectlastrow()
  
  Dim lastrow As Long
  Dim report As Worksheet
  Set report = Excel.ActiveSheet
  
  Sheets("Risks").Select
  
  lastrow = Range("K5:K48").End(xlDown).Row
  
  report.Cells(lastrow, 2).EntireRow.Select
  
  End Sub
  </code></pre>
  
  <p>To follow up:</p>
  
  <p>I'm stuck on how to structure a piece of code that:</p>
  
  <ol>
  <li>Loops through all worksheets that begin with the number 673: (e.g. 673:green, 673:blue)</li>
  <li><p>Selects the data in these worksheets from row 5 up until the last row with data - code that works for this is</p>
  
  <pre><code>With report
  .Range(.Cells(5, "K"), .Cells(.Rows.Count, "K").End(xlUp)).EntireRow.Select
  End With
  </code></pre></li>
  <li>Select the "Colours" worksheet</li>
  <li>Paste the rows at the next available blank row. There could be up to 40/50 worksheets which will have data pasted into the "Colours" worksheet so I need the data added to the next available line.</li>
  </ol>
  
  <p>Thank you in advance.</p>