Message to input Date in a cell

  • Thread starter Thread starter Fernando G,
  • Start date Start date
F

Fernando G,

I am working with a macro that perform some calculations but the last set of
calculation are base on a certain date; How can I insert in the middle of
the macro a message to input a Date, let's say "Input Date" and this should
be inserted in "O1".

Thanks
 
One way:

Dim vResult As Variant
Do
vResult = Application.InputBox( _
Prompt:="Input date:", _
Title:="your title here", _
Type:=2, _
Default:=Date)
If vResult = False Then Exit Sub 'user cancelled
Loop Until IsDate(vResult)
ActiveSheet.Range("O1").Value = vResult
 
Back
Top