ulfal028
06-09-2006, 01:12 AM
Hi,
I'm trying to copy all rows (cell cols B:J) from sheet "INDATA" that have column J value = "FR" to sheet "FR". Can't manage getting it to work properly, appreciate some help.
Dim i As Long
Dim LastRow As Long
Dim Row As Long
Dim Cel As Range
LastRow = Sheets("MVDATA").Range("J65536").End(xlUp).Row
Row = 2
For i = 2 To LastRow
If Sheets("MVDATA").Range("J" & i).Text = "FR" Then
Sheets("MVDATA").Range("B" & Cel.Row & ":J" & Cel.Row).Copy _
Destination:=Sheets("FR").Range("B" & Row)
End If
Row = Row + 1
Next i
Edited 9-Jun-06 by geekgirlau. Reason: insert line breaks in code
I'm trying to copy all rows (cell cols B:J) from sheet "INDATA" that have column J value = "FR" to sheet "FR". Can't manage getting it to work properly, appreciate some help.
Dim i As Long
Dim LastRow As Long
Dim Row As Long
Dim Cel As Range
LastRow = Sheets("MVDATA").Range("J65536").End(xlUp).Row
Row = 2
For i = 2 To LastRow
If Sheets("MVDATA").Range("J" & i).Text = "FR" Then
Sheets("MVDATA").Range("B" & Cel.Row & ":J" & Cel.Row).Copy _
Destination:=Sheets("FR").Range("B" & Row)
End If
Row = Row + 1
Next i
Edited 9-Jun-06 by geekgirlau. Reason: insert line breaks in code