heyBrooker
New Member
- Joined
- Aug 16, 2023
- Messages
- 1
- Office Version
- 365
- Platform
- Windows
- Web
I have a spreadsheet that have pay period dates, that run from V5 to AT5. We have the past pay months within 1 month grouped together and the future months within 1 month grouped together. For instance this month is August, so all the columns with dates in July, August, and September are not grouped, but all others are grouped. I have set up a user input for the numerical of the month that returns to a variant. The cells with the dates are formatted as dates dd-mm-yyyy. I have the previous groupings ungrouped and unhidden, but now I'm stuck.
Dim Cur_Month As Variant 'holds current month
Dim Col_PP As Range 'to ungroup the range V:AT columns
Cur_Month = InputBox("What month are you working with? Please enter the numerical for the month", "Choose Current Month", Month(Date))
'Selects, ungroups, and unhides the pay period section
Set Col_PP = Range("V:AT")
Col_PP.Select
Col_PP.Ungroup
Col_PP.EntireColumn.Hidden = False
Dim Cur_Month As Variant 'holds current month
Dim Col_PP As Range 'to ungroup the range V:AT columns
Cur_Month = InputBox("What month are you working with? Please enter the numerical for the month", "Choose Current Month", Month(Date))
'Selects, ungroups, and unhides the pay period section
Set Col_PP = Range("V:AT")
Col_PP.Select
Col_PP.Ungroup
Col_PP.EntireColumn.Hidden = False