Hide row where Date less than this month

lapta301

Well-known Member
Joined
Nov 12, 2004
Messages
1,001
Office Version
  1. 365
Platform
  1. Windows
I have dates in column C from row 8 and would like to have a macro which on accessing the sheet would hide all rows where the month and year of the date in column C is less than the now.

So as at today I would only want to see rows from July onwards.

As ever my thanks for any assistance
 
Fair enough appreciate the time that you have spent on this thank you
 
Upvote 0

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi,
try modification to NoSparks original suggestion to include type conversion function Clng & see if it will now work for you


Rich (BB code):
Private Sub Worksheet_Activate()
    With Range("C7", Range("C" & Rows.Count).End(xlUp))
        .AutoFilter Field:=1, _
        Criteria1:=">=" & CLng(DateSerial(Year(Date), Month(Date), 1)), _
        Operator:=xlFilterValues
    End With
End Sub

Dave
 
Upvote 0
Hi Dave thank you and it seems to be working a treat. Much appreciated
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top