Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pause a Macro

Status
Not open for further replies.

skygirl65

Technical User
Jul 18, 2004
32
US
I have a simple macro in excel that I would like to change the date in the header before moving on... how do I tell the macro to pause and wait for me to type in the Month? I am VERY much a beginner in VBA.. so be gentle!
 
First of all - why are you wanting to have it pause so YOU type in the month? Would it not be better to simply have your macro put the month in?

Gerry
 
skygirl65,
Did you try the suggestions in thread68-1171330?

[tt]_____
[blue]-John[/blue][/tt]

Help us help you. Please read FAQ181-2886 before posting.
 
I need to be able to enter the month myself....
Thanks
 
or a message box saying "please input the date"?

_________________
Bob Rashkin
 
Dim strMonth As String 'perhaps should be date later???
strMonth = InputBox("Please enter the month")
ActiveWorkbook.Worksheets("Sheet1").Cells(1, 1).Value = strMonth

'Msgbox Month(Now())..or perhaps MonthName might be handy
 
Only problem with the message box is that it is modal, and will not allow you to do anything to the worksheet whilst it is open.

Matt
 
to be more precise i tend to use
msgbox "text here"
when i want to pause and check what is going on
 
skygirl65 said:
I need to be able to enter the month myself....
I ask again, have you tried the suggestions in thread68-1171330?

[tab]From that thread:
SkipVought said:
You can input prompt using the InputBox Function.
me said:
You can interupt a macro by pressing [Esc], but why not have the macro prompt you for the month?
Code:
...
MyDate = inputbox "Please enter the Date you would like to appear in the header"
...
xlbo said:
Alternatively, if you simply want to enter the data into a cell, you can use
Code:
.....code runs

stop

.....code restarts

Please state what you have tried and why the results aren't satisfactory instead of just rephrasing the question over and over.

[tt]_____
[blue]-John[/blue][/tt]

Help us help you. Please read FAQ181-2886 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top