Narozeniny
Private Sub Workbook_Open()
Dim narozky(600, 2) As String
Dim datum As Date
Worksheets("List2").Cells(1, 5).Value = Format(Worksheets("List2").Cells(1, 5), "dd.mm.yyyy")
datum = Left(CStr(Worksheets("List2").Cells(1, 5).Value), 5) 'potřebuji jen prvních 5 znaků
For i = 2 To Worksheets("List2").Cells(Rows.Count, "a").End(xlUp).Row
Worksheets("List2").Cells(i, "b").Value = Format(Worksheets("List2").Cells(i, "b"), "dd.mm.yyyy")
prvnichPet = Left(CStr(Worksheets("List2").Cells(i, "b").Value), 5)
If prvnichPet = datum Then
narozky(i, 0) = CStr(Worksheets("List2").Cells(i, "a").Value)
narozky(i, 1) = CStr(Worksheets("List2").Cells(i, "b").Value)
narozky(i, 2) = CStr(Worksheets("List2").Cells(i, "c").Value)
zobrazeni = zobrazeni & narozky(i, 0) & " ( " & narozky(i, 1) & " ) - " & narozky(i, 2) & vbNewLine 'vbCrLf
End If
Next i
MsgBox zobrazeni
End Sub