title: VBA - How to copy and data from a worksheet in a certain condition to the last worksheet
body: <p>I'm new with VBA and I am trying to create a macro for work to make everyone's life easier. My goal is to copy rows (or just copy the data in the first column when the second column is "0") from one worksheet named "Bulk Update" with the condition of column B having the value "0" to the last worksheet, at the bottom of the worksheet after the data. I don't know how to reference the last worksheet name. Here is the code that I made (please don't judge me as I am still new and googling around), which I know is completely wrong... </p>
  
  <pre><code>Public Sub CNPPrevOOS()
      Worksheets("Bulk Update").Select
  
      a = Worksheets("Bulk Update").Cells(Rows.Count, 1).End(xlUp).Row
  
      For i = 2 To a
  
          If Worksheets("Bulk Update").Cells(i, 2).Value = "0" Then
  
  
          Selection.Copy
  
          ThisWorkbook.Worksheets(ThisWorkbook.Sheets.Count).Range("A1").Value = 100
  
          Range("A30000").Select
  
          Selection.End(xlUp).Select
  
          ActiveCell.Offset(1, 0).Select
  
          ActiveSheet.Paste
  
          End If
      Next
  
  End Sub
  </code></pre>