Inputting from message box

E

Ewing25

Hey guys,

Simple questions.

Im trying to get a imput box come up when you open the worksheet that asks
for your name. Then it takes what you inputted and puts it into a the cell E8
in a sheet named Summary.

I have this so far:

Dim Message1, Title1, MyValues
Message = "Please enter your name (First and Last)"
Title = "Name" '<--Change
MyValues = InputBox(Message, Title)

Thanks!
 
H

Harald Staff

Try even simpler:

Sub Auto_open()
Sheets("Summary").Range("E8").Value = _
InputBox("Yo name:", "Important")
End Sub

HTH. Best wishes Harald
 
J

JLGWhiz

Dim Message1, Title1, MyValues
Message = "Please enter your name (First and Last)"
Title = "Name" '<--Change
MyValues = InputBox(Message, Title)
Sheets("Summary").Range("E8") = MyValues
 
J

JW

Hey guys,

Simple questions.

Im trying to get a imput box come up when you open the worksheet that asks
for your name. Then it takes what you inputted and puts it into a the cellE8
in a sheet named Summary.

I have this so far:

Dim Message1, Title1, MyValues
     Message = "Please enter your name (First and Last)"
    Title = "Name"  '<--Change
    MyValues = InputBox(Message, Title)

Thanks!

Dim Message1 As String, Title1 As String
Dim MyValues As String
Message = "Please enter your name (First and Last)"
Title = "Name" '<--Change
MyValues = InputBox(Message, Title)
If MyValues <> vbNullString Then _
Sheets("Summary").Range("E8").Value = MyValues
 
E

Ewing25

Great thanks!

JLGWhiz said:
Dim Message1, Title1, MyValues
Message = "Please enter your name (First and Last)"
Title = "Name" '<--Change
MyValues = InputBox(Message, Title)
Sheets("Summary").Range("E8") = MyValues
 
J

JLGWhiz

That is efficient, but if you want to use the value again, you still need a
variable.
 

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