Sub makro1()
Dim dtMin As Date
Dim dtMax As Date
Dim Sloupec1 As String
Dim Sloupec2 As String
Dim lngLastRow1 As Long
Dim lngLastRow2 As Long
Dim StartD As Date, EndD As Date
Sloupec1 = InputBox("Zadej první sloupec")
Sloupec2 = InputBox("Zadej druhý sloupec")
lngLastRow1 = ActiveSheet.Cells(Rows.Count, Sloupec1).End(xlUp).Row
lngLastRow2 = ActiveSheet.Cells(Rows.Count, Sloupec2).End(xlUp).Row
dtMin = WorksheetFunction.Min(Range(Cells(1, Sloupec1), Cells(lngLastRow1, Sloupec1)))
dtMax = WorksheetFunction.Max(Range(Cells(1, Sloupec2), Cells(lngLastRow2, Sloupec2)))
MsgBox dtMin
MsgBox dtMax
StartD = dtMin
EndD = dtMax + 1
For i = 1 To EndD - StartD
Cells(i, 3) = StartD + i - 1
Next i
End Subcitovat