Simple seach and copy help needed

  • Thread starter Thread starter alextransamerica
  • Start date Start date
A

alextransamerica

hi, I'm a noob at programming and this should be a breeze for the
gurus.
I need to search down a column for values >100000 and if found, copy
the whole row to sheet 2. It should loop through all the data in the
table until the last row.
simple as that.

thanks!!
 
Sub Macro1()
Dim iCt As Integer
Dim iRow1 As Integer
Dim iRow2 As Integer

iRow1 = Sheets(1).Range("A65536").End(xlUp).Row
For iCt = 1 To iRow1
If Sheets(1).Cells(iCt, 1) > 10000 Then
iRow2 = iRow2 + 1
Sheets(1).Rows(iCt).Copy Sheets(2).Rows(iRow2)
End If
Next iCt

End Sub

Hth,
Merjet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top