Can the InputBox Prompt have Carriage Returns?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am creating an InputBox and I have 8 options a person may select from.

I would like my InputBox to display the choices in a list form, but I cannot
figure out how to enter carriage returns.

Right now the input box has one statement that looks like this:

Enter the number of the type of work to be performed 1. Excavation 2.
Excavation/Footings 3. Sewer 4. Sewer/Water 5. Water 6. Storm 7.
Irrigation 8. Electric

I want it to look like this:

Enter the number of the type of work to be performed

1. Excavation
2. Excavation/Footings
3. Sewer
4. Sewer/Water
5. Water
6. Storm
7. Irrigation
8. Electric

I have placed (Chr(13)) before each number in the list, but the VB editing
box returns an error when I try to move off the coding line.

Do you have any help for me on this one? I thank you in advance.

Tofer
 
ans = InputBox("Enter the number of the type of work to be performed" &
vbNewLine & vbNewLine & _
"1. Excavation" & vbNewLine & _
"2. Excavation/Footings" & vbNewLine & _
"3. Sewer" & vbNewLine & _
"4. Sewer/Water" & vbNewLine & _
"5. Water" & vbNewLine & _
"6. Storm" & vbNewLine & _
"7. Irrigation" & vbNewLine & _
"8. Electric")


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
Note that this code

ans = InputBox("Enter the number of the type of work to be performed" &
vbNewLine & vbNewLine & _

should all be on one line.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 

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

Back
Top