# copy values if they are less then 1.67

#### amna77

##### Active Member
Hi, i have these following codes in the module. what they are for is they are looking value in column V, if value is less then 1.67 then it copyies the whoe row and paste that into sheet A. which is doing fine. my values are in negitive numbers as well, like -0.27 etc. now the thing is with my these following codes, it copies the empty rows as well. What i want to do is, if there is no value in column V then dont copy, onlu copy if value is less then 1.67.

Sheets("ISRDATA").Select
' Find the last row of data
FinalRow = Range("A65536").End(xlUp).Row
' Loop through each row
For x = 16 To FinalRow
' Decide if to copy based on column V
thisvalue = Range("V" & x).Value
If thisvalue < 1.67 Then
Range("A" & x & ":AL" & x).Copy
Sheets("a").Select
NextRow = Range("A65536").End(xlUp).Row + 1
Range("A" & NextRow).Select
ActiveSheet.Paste
Sheets("ISRDATA").Select

End If
Next x

### Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use \$ signs: \$V\$2:\$Z\$99 will always point to V2:Z99, even after copying
amna77 said:
if there is no value in column V then dont copy
Maybe this, with my added code in bold:

Sheets("ISRDATA").Select
' Find the last row of data
FinalRow = Range("A65536").End(xlUp).Row
' Loop through each row
For x = 16 To FinalRow

'Decide if there is a value in the column V cell
If Len(Cells(x, 22).Value) > 0 Then

' Decide if to copy based on column V
thisvalue = Range("V" & x).Value
If thisvalue < 1.67 Then
Range("A" & x & ":AL" & x).Copy
Sheets("a").Select
NextRow = Range("A65536").End(xlUp).Row + 1
Range("A" & NextRow).Select
ActiveSheet.Paste
Sheets("ISRDATA").Select

'Put in an End If for the evaluation of the column V cell
End If

'Presumably in your code, down here somewhere is
Next x

Thanks for help, it is working for me now.
Once again, thanks very much

Replies
7
Views
427
Replies
11
Views
352
Replies
5
Views
203
Replies
2
Views
501
Replies
7
Views
204

1,219,960
Messages
6,151,163
Members
451,012
Latest member
OH650R

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back