
Originally Posted by
Wheelie686
everything from April 8 (oldest date) to June 21 (previous Thursday) grouped and everything else stays as is.
Sub HideOld2()
Dim PreviousThursday As Date, rngEnd As Range
PreviousThursday = Date - Weekday(Date, 5) + 1
Set rngEnd = Rows(5).Find(PreviousThursday, , xlFormulas, xlWhole, 1, 2, 0)
If Not rngEnd Is Nothing Then
Range("B5", rngEnd).Group
ActiveSheet.Outline.ShowLevels RowLevels:=0, ColumnLevels:=1
Range("A1").Select
Else
MsgBox Format(PreviousThursday, "dddd mmm d, yyyy"), vbExclamation, "Previous Thursday Not Found"
End If
End Sub
Bookmarks