ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Including prompts in macros (https://www.excelbanter.com/excel-programming/314766-including-prompts-macros.html)

BeardT

Including prompts in macros
 
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?

Frank Stone

Including prompts in macros
 
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
-----Original Message-----
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?
.


JE McGimpsey

Including prompts in macros
 
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)



In article ,
BeardT wrote:

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?


Bob Phillips[_6_]

Including prompts in macros
 
look at InputBox in VBA help

--

HTH

RP

"BeardT" wrote in message
...
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?





All times are GMT +1. The time now is 01:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com