PDA

View Full Version : copy only positive values



lior03
08-10-2006, 02:29 AM
hello
i have a column with numerical values.i want to copy to the column next to the active column only values greater then zero.


Dim cell As Range
For Each cell In Range("B3:B29")
If cell.Value < 0 Then
cell.Offset(0, 1).Value = ""
End If
Next


thanks

Bob Phillips
08-10-2006, 03:20 AM
Dim cell As Range
For Each cell In Range("B3:B29")
If cell.Value > 0 Then
cell.Offset(0, 1).Value = cell.Value
End If
Next