Macro/message box to prompt user for their name and save name to cell

R

robertguy

Hi,

Any assistance would be greatly appreciated

I need a macro that displays a message box which prompts the user fo
their name. When the user enters their name the name is then the cop
to a particular cell e.g. C2


Many thanks


Ro
 
P

Paul B

Rob, how about something like this,

Sub test()
MyName = InputBox("Enter Your Name", "What Is Your Name?")
If MyName = "" Then

Exit Sub
End If
Sheet1.Range("C2").Value = MyName

End Sub

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 97 & 2000
** remove news from my email address to reply by email **
 

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