Excel message box

R

Rock

I am looking for help with a macro because the macro I have so far is not
close to accomplishing my desired procedure. Can you help me?

Sub MsgBoxmacro()
MsgBox "Question #1 here"
MsgBox "Question #2 here"
MsgBox "Question #3 here"
MsgBox "Question #4 here"
MsgBox "Question #5 here"
MsgBox "Question #6 here"
MsgBox "Question #7 here"
End Sub

I have seven questions in range A1:A7. I would like to create a macro that
when activated will perform the following functions. Display 1st question
(cell A1) in a message box with field below it to give the answer. After the
question has been answered I can click stop or continue on the message box.

If I click continue the message box will disappear. The question will be
pasted into cell B2. The answer will be pasted into B4 and a new message box
(same format) will appear with the 2nd question in cell A2.

As long as I click continue on the message box the procedure will continue
to repeat itself with the questions and answers. For example, 2nd question
(pasted into B6 and B8), 3rd question (pasted into B10 and B12), 4th question
(pasted into B14 and B16), 5th question pasted into B18 and B20), 6th
question (pasted into B22 and B24), 7th question (pasted into B26 and B28),
and then loop back to the 1st question (pasted into B30 and B32), 2nd
question (pasted into B34 and B36), 3rd question (pasted into B38 and B40),
etc until I select stop on the message box.

If I click stop on the message box the message box will disappear. The
question will be pasted two rows below the last row with data in Column B.
The answer will be pasted two rows below the question, and the program will
stop running.

Can you help me with this?
 
J

john

Hi Rock,
I think I may have something that you can adapt to meet your need - do you
have an email address I can send to?
 
J

JLGWhiz

You night also look into using a UserForm with Label and TextBox controls to
do what you want. Message boxes have verfy limited capabilities when trying
to interact with users. Also, using the controls on a UserForm allows you
to interchange data between the worksheet and the controls on the form,
rather than try to pause the macro and do that work. In VBA pausing the
macro while a user manipulates data on the worksheet is not a practical
approach, since that is not a built in facility of VBA.
 

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

Top