Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

excel - 31st of January is missing in my calendar

As you can see in the screenshots the calendar is showing just 30 days of January and the day 31 is missing. when I try to add this day manually by adding a new column(AG) it works. but when i scroll to the next month which is February the column AG turns blank! and when I scroll back to January its again 30 days! enter image description here enter image description here enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Because You hide Columns("C:NI") and unhide only 30 columns from column C to column AF.

Range("B3").Value equals to 1 and Range("B3").Value * 31 - 29 equals to 2. Likewise, Range("B3").Value * 31 + 1 equals to 32. So, you unhide only 30 columns (32-2)! Just change your VBA code Range("B3").Value * 31 - 29 to Range("B3").Value * 31 -28 and Range("B3").Value * 31 + 1 to Range("B3").Value * 31 + 2 :

Sub showcalendar()
   LeaveTracker.Columns("C:NJ").Hidden = True
   LeaveTracker.Range(Columns(Range("B3").Value * 31 - 28), Columns(Range("B3").Value * 31 + 2)).Hidden = False
End Sub

And one more thing, change all Column()-1 to Column()-2 in your excel formulaes. Here is your repaired workbook. Check and tell me any your ideas.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...