Hi,
I would like to auto hide the columns is the date in row 2 is less than today.
thanks,
MK
Hi,
I would like to auto hide the columns is the date in row 2 is less than today.
thanks,
MK
Assume you wish to hide only column B, then this code would work if your date is in cell A2.
![]()
Sub HideCol() Dim d As Date d = Range("A2") If d < Date Then Range("B:B").EntireColumn.Hidden = True End If End Sub
Alan עַם יִשְׂרָאֵל חַי
Change an Ugly Report with Power Query
Database Normalization
Complete Guide to Power Query
Man's Mind Stretched to New Dimensions Never Returns to Its Original Form
Another:
![]()
Sub emrytate() Dim i As Long For i = ActiveSheet.UsedRange.Columns.Count To 1 Step -1 If Cells(2, i).Value < Date Then Cells(2, i).EntireColumn.Hidden = True Next i End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks