Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to Prompt User to Close After Saving Rutabaga Excel Discussion (Misc queries) 2 July 12th 07 12:38 AM
save prompt for user exit, but no save prompt for batch import? lpj Excel Discussion (Misc queries) 1 February 25th 06 02:08 AM
Macro: Prompt user for xls file to add chart Flystar[_4_] Excel Programming 0 May 10th 04 06:09 AM
Prompt For User Mouse Input In Macro? oBis Excel Programming 0 May 6th 04 02:50 PM
Prompt User to Enter Data with a macro Rebecca[_6_] Excel Programming 2 August 23rd 03 03:55 PM


All times are GMT +1. The time now is 05:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"