Move one cell to another

M

Mike

I need to copy the content of one cell to another when a different cell is
greater than 239.
Example: if N20 is greater than R20(value 239) then copy the content of B20
to S20.

OR

A method to delete all records that have a value less than 240 in column N.

Any help would be appreciated.

Thanks,

Mike
 
B

Bernard Liengme

VBA Subroutine

Sub TryMe()
'Deletes rows where the value in column N is less than 240
Dim RowNdx As Long
Dim LastRow As Long

LastRow = Cells(Rows.Count, "N").End(xlUp).Row

For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "N").Value < 240 Then
Rows(RowNdx).Delete
End If
Next RowNdx

End Sub


best wishes
 

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

Top