Talvez assim:
Private Sub CommandButton1_Click()
Dim cMes As String, cDia As String
TextBox3 = Format(VBA.DateAdd("d", VBA.CDec(TextBox2), VBA.CDate(Me.TextBox1)), "dd/mm/yyyy")
cMes = VBA.DateDiff("m", TextBox1, TextBox3)
cDia = VBA.DateDiff("d", TextBox1, VBA.DateAdd("m", cMes * -1, TextBox3))
If cMes > 1 Then
cMes = cMes & " Meses"
Else
cMes = cMes & " Mês"
End If
If cDia > 1 Then
cDia = cDia & " Dias"
Else
cDia = cDia & " Dia"
End If
MsgBox "A nova data: " & TextBox3 & Chr(10) & cMes & " ; " & cDia
End Sub
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 07/01/2017 7:39 am