VBA hide/unhide rows based on days of the month

vendonz

New Member
Joined
Jan 11, 2025
Messages
2
Office Version
  1. 2013
Platform
  1. Windows
Hi everyone can you help me get done a VBA auto hide/unhide days based on month?

i have this simple code but it has flaws on unhiding/hiding when i change the month

Sub Hide_Day()
Dim Num_Row As Long

For Num_Row = 62 To 67

If Month(Cells(Num_Row, 28)) >= Cells(11, 27) Then

Rows(Num_Row).Hidden = True

Else

Rows(Num_Row).Hidden = False

End If

Next

End Sub


UnitDG1
MonthJanuary2025
DateStartSyncMinMaxStartSync
1
0:000:000:00 0:00
2
0:000:000:00 0:00
3
0:000:000:00 0:00
4
0:000:000:00 0:00
5
0:000:000:00 0:00
6
0:000:000:00 0:00
7
0:000:000:00 0:00
8
0:000:000:00 0:00
9
0:000:000:00 0:00
10
0:000:000:00 0:00
11
0:000:000:00 0:00
12
0:000:000:00 0:00
13
0:000:000:00 0:00
14
0:000:000:00 0:00
15
0:000:000:00 0:00
16
0:000:000:00 0:00
17
0:000:000:00 0:00
18
0:000:000:00 0:00
19
0:000:000:00 0:00
20
0:000:000:00 0:00
21
0:000:000:00 0:00
22
0:000:000:00 0:00
23
0:000:000:00 0:00
24
0:000:000:00 0:00
25
0:000:000:00 0:00
26
0:000:000:00 0:00
27
0:000:000:00 0:00
28
0:000:000:00 0:00
29
0:000:000:00 0:00
30
0:000:000:00 0:00
31
0:000:000:00 0:00
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Format-DoNotEdit-Backup.xlsx
AB
6229
63
6430
65
6631
67
DG1
Cell Formulas
RangeFormula
A62,A66,A64A62=DATE($AD$2,$AD$1,AA62)


Format-DoNotEdit-Backup.xlsx
ADAE
1101/01/2025
22025
DG1
Cell Formulas
RangeFormula
AE1AE1=DATE(AD2,AD1,1)


can i add case on this that will determine eomonth as basis of hide
 
Upvote 0

Forum statistics

Threads
1,225,628
Messages
6,186,103
Members
453,337
Latest member
fiaz ahmad

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