vba code for positioning an input box

B

Bonnie

I want to be able to position the input box. When I type in the numbers to
position the box, I get an error message. Below is the code.

answer = InputBox(prompt:="Type the one word(s) that makes the following
sentence correct:" & Chr$(13) & Chr$(13) & _
"Are everyone here?", _
Title:="Question 7", ,100,100)

Any suggestions? Thanks
 
S

Shyam Pillai

Bonnie,
If you use named parameters then all arguments must be named.

answer = InputBox(prompt:="Type the one word(s) that makes the following
sentence correct:" & Chr$(13) & Chr$(13) & _
"Are everyone here?", _
Title:="Question 7", XPos:=100, YPos:=100)
 
D

David M. Marcovitz

You can't mix and match using parameter names (such as Title:= ) with
using parameter positions. Since your parameters are all in the right
order, you can cut out the names:

answer = InputBox("Type the one word(s) that makes the following sentence
correct:" & Chr$(13) & Chr$(13) & _
"Are everyone here?", _
"Question 7", , 100, 100)

Alternatively, only use names and change 100 to xpos:=100 and to ypos:=
100

Watch out for line breaks in the above code as the newsreader I use chops
things up.

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 

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