As the title really I want to be able to set a datepicker DTPicker21 to todays date when the workbook is opened
Secondally I would like to be able to set a second datepicker DTPicker22 to todays date plus 1 year
So basically what do I need to add to the Workbook_Open function?
As I use the change to a datepicker to hide various columns (Code below) I think the next challenge will then be how to also hide those columns when the dates are set on open.
'h![]()
ide columns less than start date' Private Sub DTPicker21_Change() Application.ScreenUpdating = False For Each Cll In Range("F3:FF3") If Cll.Value < DTPicker21.Value Or Cll.Value > DTPicker22.Value Then Cll.EntireColumn.Hidden = True Else Cll.EntireColumn.Hidden = False Next Cll Application.ScreenUpdating = True Set WBOpen = False End Sub 'hide columns greaterthan than end date' Private Sub DTPicker22_Change() Application.ScreenUpdating = False For Each Cll In Range("F3:FF3") If Cll.Value > DTPicker22.Value Or Cll.Value < DTPicker21.Value Then Cll.EntireColumn.Hidden = True Else Cll.EntireColumn.Hidden = False Next Cll Application.ScreenUpdating = True Set WBOpen = False End Sub
Complete novice thrashing posted examples
Thanks in advance
Bookmarks