Including prompts in macros

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'd like to write a macro where it prompts me to enter a value for a cell
half way through without stopping. For example, I might like to include a
date once a set of data has been manipulated, after entering this, I'd like
the macro to continue running. Is there a way Excel can do this?
 
hi,
yes there is a way. assuming cell = A1

Private Sub inputdate()
Range("A1").value = inputbox("enter a date")
end sub

adjust A1 for the cell you want the date input to. you
didn't include enough info to write more of the macro.
Regards
Frank
 
one way:

Dim vResponse As Variant
Do
vResponse = Application.InputBox( _
Prompt:="Enter Date:", _
Title:="Date Entry", _
Default:=Format(Date, "mm/dd/yyyy"), _
Type:=2)
If vResponse = False Then Exit Sub 'User cancelled
Loop Until IsDate(vResponse)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top