Hi all,
I'm slightly embarrassed to be asking this, as I feel it should be simple.
I have no experience with programming or VBA, but I can usually find something similar to what I want online, and then make changes or adjustments to get it to do what I need. I'm struggling to find something similar to this....likely because it IS so simple...but I can't work it out.
I have a series of numbers in Column O, sorted high to low, and I want to go tothe first cell in the column with a number less than 1000, after which I am good with the rest of the routine.
I have tried many different variations and versions...this is where I have got to so far....although, as any of you who can read this stuff will realise, it doesn't work - it simply selects the last (non-blank) row of Column O.
What am I doing wrong please?
I'm slightly embarrassed to be asking this, as I feel it should be simple.
I have no experience with programming or VBA, but I can usually find something similar to what I want online, and then make changes or adjustments to get it to do what I need. I'm struggling to find something similar to this....likely because it IS so simple...but I can't work it out.
I have a series of numbers in Column O, sorted high to low, and I want to go tothe first cell in the column with a number less than 1000, after which I am good with the rest of the routine.
I have tried many different variations and versions...this is where I have got to so far....although, as any of you who can read this stuff will realise, it doesn't work - it simply selects the last (non-blank) row of Column O.
What am I doing wrong please?
VBA Code:
Sub DeleteBelow1K()
last_row = ActiveSheet.UsedRange.Rows.Count
For i = 1 To last_row
If i < 1000 Then
Cells(i, "O").Select
End If
Next i
End Sub