In my sheet 'Booking' I have a range C2:J36 that represents a calendar of the current…
- User
In my sheet 'Booking' I have a range C2:J36 that represents a calendar of the current and next four months, a total of five months. Column C2:C36 has formulas (like: =IF('Asset Calendar'!J2<>"",'Asset Calendar'!J2,"")) which shows the Months, and the range is formated as Custom mmm yy. Each month is allocated 7 rows. The first row for each month D to J contains Text Values of the Day of the Week (like DDD) The actual days of the month are shown in the 2nd to 7th row of each month. Each cell in the row has formulas (like: =IF('Asset Calendar'!K3<>"",'Asset Calendar'!K3,".")) which shows the numerical day of the month, and each cell is formated as Custom dd.
I want a VBA code that will identify the current day of the current month and increase the font size in the cell to 14 point Bold. I also need that when the day changes, prevoius cell font size is returned to the original 11 point Regular.
The Table Range arragement for the five months is as follows. CURRENT MONTH 1: C2:C8 has formulas (like: =IF('Asset Calendar'!J2<>"",'Asset Calendar'!J2,"")) which show the Month as mmm yy D2:J2 shows the DAY of the week as text like DDD. D3:J8 has formulas (like: =IF('Asset Calendar'!K3<>"",'Asset Calendar'!K3,".")) which shows the numerical day of the month as dd. NEXT MONTH 2: C9:C15 has formulas (like: =IF('Asset Calendar'!J2<>"",'Asset Calendar'!J2,"")) which show the Month as mmm yy D9:J9 shows the DAY of the week as text like DDD. D10:J15 has formulas (like: =IF('Asset Calendar'!K3<>"",'Asset Calendar'!K3,".")) which shows the numerical day of the month as dd. NEXT MONTH 3: C16:C22 has formulas (like: =IF('Asset Calendar'!J2<>"",'Asset Calendar'!J2,"")) which show the Month as mmm yy D16:J16 shows the DAY of the week as text like DDD. D17:J22 has formulas (like: =IF('Asset Calendar'!K3<>"",'Asset Calendar'!K3,".")) which shows the numerical day of the month as dd. NEXT MONTH 4: C23:C29 has formulas (like: =IF('Asset Calendar'!J2<>"",'Asset Calendar'!J2,"")) which show the Month as mmm yy D23:J23 shows the DAY of the week as text like DDD. D24:J29 has formulas (like: =IF('Asset Calendar'!K3<>"",'Asset Calendar'!K3,".")) which shows the numerical day of the month as dd. LAST MONTH 5: C30:C36 has formulas (like: =IF('Asset Calendar'!J2<>"",'Asset Calendar'!J2,"")) which show the Month as mmm yy D30:J30 shows the DAY of the week as text like DDD. D31:J36 has formulas (like: =IF('Asset Calendar'!K3<>"",'Asset Calendar'!K3,".")) which shows the numerical day of the month as dd.
- Assistant
- User
Error: Object required, on the line: For Each monthCell In monthRanges
- Assistant
- User
The module below does not have to store the current the lastHighlightedDate. When the module runs, let start by setting the range D2:J36 to Font.Size = 11 Font.Bold = False
Sub HighlightCurrentDay()
code - Assistant