in excel 2007 trying to loop through (un-fixed length) column (say C) and where row value matches (say "High"), then transfer value of cells Dx and Bx to sheet "transfer" in new row, where x is the row# where the matches are found. Assume "transfer" exists.
So far I've got this:
Public Sub CopyRows()
Sheets("Sheet1").Select
'Find the last row of data
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
'Loop through each row
For x = 1 To FinalRow
'Decide if to copy based on column C
ThisValue = Cells(x, 3).Value
If ThisValue = "High" Then
Cells(x, 1).Resize(1, 33).Copy
Sheets("Transfer").Select
NextRow = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(NextRow, 1).Select
ActiveSheet.Paste
Sheets("Sheet1").Select
End If
Next x
End Sub