Hello,
I'd really appreciate some help. I have a series of rows, with column C containing only dates. I'd like to be able to easily delete all rows where the cell in C contains a date prior to, say 16/06/2017. I know absolutely no VBA, but have naively tried the below based on posts I found here from 2012:
All that happens is that rows where the date has an odd-numbered day disappear, but that's not what I need and I'm terribly confused.
I'd be ever so grateful for some help as a solution would save me many hours of work.
Many thanks,
AnyaK
P.S. I'd be happy to post an example of the table, but won't be able to do that for a few hours as it's not possible from work computers. Apologies
I'd really appreciate some help. I have a series of rows, with column C containing only dates. I'd like to be able to easily delete all rows where the cell in C contains a date prior to, say 16/06/2017. I know absolutely no VBA, but have naively tried the below based on posts I found here from 2012:
Code:
Sub DeleteMyRows() 'or Button1_Click()Dim Rng As Range, Cell As Range
Set Rng = Range(Range("c1"), Range("c" & Rows.Count).End(xlUp))
For Each Cell In Rng
If Cell > 16 / 6 / 2017 Then
Cell.EntireRow.Delete
End If
Next Cell
End Sub
All that happens is that rows where the date has an odd-numbered day disappear, but that's not what I need and I'm terribly confused.
I'd be ever so grateful for some help as a solution would save me many hours of work.
Many thanks,
AnyaK
P.S. I'd be happy to post an example of the table, but won't be able to do that for a few hours as it's not possible from work computers. Apologies