JiminyKricket
New Member
- Joined
- May 17, 2011
- Messages
- 8
Hi,
Really struggling with this one..
I am trying to use an IF statement to compare a cell in a number of rows to an individual cell, i.e in cell FQ1 i have a date in the format YYYYMMDD, and i have a number of rows (varies but 3k+). If a cell in column O does NOT equal that in FQ1 then i want it to copy and paste the entire row to a new worksheet.
The bit i'm particularly struggling with is that in the new worksheet there is already a varying amount of data already inputted, and so the row has to be pasted 4 rows below the last row used.
Further to this however there will likely be numerous rows that need to be copied but they need to be below each other, i.e...
Old row---------
Old row---------
Old row---------
New Row-------
New Row-------
New Row-------
New Row-------
What i have so far is the following;
With Worksheets("Trade File")
irow = .Range("O50000").End(xlUp).Row
For i = 2 To irow
If Range("O" & i) <> Range("FQ1") Then
Range("O" & i).EntireRow.Copy
***Sheets("Facilitation Fees").Range("A" & j + 4).Row.Paste
End If
Next i
End With
Obviously the *** row is incorrect!
Many thanks in advance
Really struggling with this one..
I am trying to use an IF statement to compare a cell in a number of rows to an individual cell, i.e in cell FQ1 i have a date in the format YYYYMMDD, and i have a number of rows (varies but 3k+). If a cell in column O does NOT equal that in FQ1 then i want it to copy and paste the entire row to a new worksheet.
The bit i'm particularly struggling with is that in the new worksheet there is already a varying amount of data already inputted, and so the row has to be pasted 4 rows below the last row used.
Further to this however there will likely be numerous rows that need to be copied but they need to be below each other, i.e...
Old row---------
Old row---------
Old row---------
New Row-------
New Row-------
New Row-------
New Row-------
What i have so far is the following;
With Worksheets("Trade File")
irow = .Range("O50000").End(xlUp).Row
For i = 2 To irow
If Range("O" & i) <> Range("FQ1") Then
Range("O" & i).EntireRow.Copy
***Sheets("Facilitation Fees").Range("A" & j + 4).Row.Paste
End If
Next i
End With
Obviously the *** row is incorrect!
Many thanks in advance