Private Sub CommandButton1_Click()
Dim iDate As Date, nDate As Date
Dim n As Long, i As Long, j As Long
Dim bln As Boolean
With TextBox3
If .Value = "" Or Not IsDate(.Value) Then
MsgBox "Enter valid date"
.SetFocus
Exit Sub
End If
iDate = CDate(.Value)
End With
With TextBox6
If .Value = "" Or Not IsNumeric(.Value) Then
MsgBox "Enter valid period"
.SetFocus
Exit Sub
End If
n = Val(.Value)
End With
j = 0
For i = 1 To 15
If Me.Controls("H" & i).Value = "" Then
bln = True
End If
If bln Then
j = j + 1
nDate = DateSerial(Year(iDate), Month(iDate) + (n * j), Day(iDate))
Me.Controls("H" & i).Value = Format(nDate, "dd/mm/yyyy")
End If
Next
End Sub