Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prompt a user during a macro
I want to prompt a user to enter a year, such as 1999, then fill a range of
cells in a column while a macro is running. Is this possible and how would I do it? Thank you. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prompt a user during a macro
The easiest way is to use an input box something like this...
Sub Test() Sheets("Sheet1").Range("A1:A10").Value = InputBox("Please enter the year", _ "Report Year") End Sub -- HTH... Jim Thomlinson "goplayoutside" wrote: I want to prompt a user to enter a year, such as 1999, then fill a range of cells in a column while a macro is running. Is this possible and how would I do it? Thank you. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prompt a user during a macro
Sub test()
Dim Yr As Long MsgBox "Code runs" Yr = Val(InputBox("Which year ?", _ "Entry", Year(Date))) Select Case Yr Case 1 To Year(Date) MsgBox Yr & " was a very good year" Case Year(Date) + 1 To 2999 MsgBox Yr & " is future" Case Else End Select End Sub You're welcome. "goplayoutside" skrev i melding ... I want to prompt a user to enter a year, such as 1999, then fill a range of cells in a column while a macro is running. Is this possible and how would I do it? Thank you. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prompt a user during a macro
AWESOME. Thank you.
"Jim Thomlinson" wrote: The easiest way is to use an input box something like this... Sub Test() Sheets("Sheet1").Range("A1:A10").Value = InputBox("Please enter the year", _ "Report Year") End Sub -- HTH... Jim Thomlinson "goplayoutside" wrote: I want to prompt a user to enter a year, such as 1999, then fill a range of cells in a column while a macro is running. Is this possible and how would I do it? Thank you. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to Prompt User to Close After Saving | Excel Discussion (Misc queries) | |||
save prompt for user exit, but no save prompt for batch import? | Excel Discussion (Misc queries) | |||
Macro: Prompt user for xls file to add chart | Excel Programming | |||
Prompt For User Mouse Input In Macro? | Excel Programming | |||
Prompt User to Enter Data with a macro | Excel Programming |