Hello anybody,
following piece of code results in "Type mismatch" error:
...
Dim CellRng As Range
...
For Each cell In CellRng
If (WorksheetFunction.WorkDay(Date, 1, ThisWorkbook.Worksheets("2-KALENDÁŘ A SVÁTKY").Range("D3:D42")) - cell.Value > 0) And (cell.Value <> "") And (cell.Offset(0, -4) <> "a") Then
IsMsgYel = True
CellDateF = Format(cell, "dd.mm.yyyy")
MsgYel = MsgYel & CellDateF & " - " & cell.Offset(0, 1).Value & " (" & cell.Offset(0, 2).Value & ")" & Date & vbCrLf
End If
Next
...
The cells in range contain dates, I know that WorksheetFunction.WorkDay returns "double"... I tried some conversions (cell.Value to double, WorksheetFunction.WorkDay to date), but no success.
Thanks for any help.
Bookmarks