Hello, guys
I want my macro to delete a specific row if the figure on column A is negative. Therefore, I have came up with the following code:
However, it's not working and I can't figure out why.
Can you help me?
Thanks,
ORoxo
I want my macro to delete a specific row if the figure on column A is negative. Therefore, I have came up with the following code:
Code:
Private Sub CommandButton3_Click()Dim r As Integer
r = 1
If Cells(r, 1) < 0 Then
Rows.Delete
Else
r = r + 1
End If
End Sub
However, it's not working and I can't figure out why.
Can you help me?
Thanks,
ORoxo