последняя заполненная ячейка столбца "Фамилия"Последнюю строку каким критерием определять?
Option Explicit
Const iTableRowStart As Long = 3
Const iTableColumnStart As Long = 2
Const iColor = vbBlue
Public Sub main()
Dim iTableRowEnd As Long
Dim MonthNum As Long
Dim MonthName As String
Dim dDate As Date
iTableRowEnd = Cells(Rows.Count, 1).End(xlUp).Row
MonthName = [N1]
MonthNum = Month(DateValue("01 " & MonthName & " 2018"))
Dim i As Long
For i = iTableColumnStart To iTableColumnStart + 30
If IsNumeric(Cells(iTableRowStart, i)) Then
dDate = DateSerial(Year(Now), MonthNum, Cells(iTableRowStart, i))
If Weekday(dDate, vbMonday) = vbSunday Then
Range(Cells(iTableRowStart, i), Cells(iTableRowEnd, i)).Interior.Color = iColor
End If
End If
Next
End Sub
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?