View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Add days to a date

Option Explicit
Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
If IsDate(Me.TextBox1.Value) Then
Me.TextBox2.Value _
= Format(CDate(Me.TextBox1.Value) + 90, "mmmm dd, yyyy")
Me.TextBox3.Value _
= Format(CDate(Me.TextBox1.Value) + 120, "mmmm dd, yyyy")
Else
Beep
Cancel = True
End If
End Sub


kk wrote:

With three textboxes(1,2 and 3) in a userform1.
If I insert a date in textbox1, how do I get textbox2 to show the date
(textbox1)+90 days and textbox3 to show the date (textbox1)+120 days?
Using vb code?
--
kk


--

Dave Peterson