View Full Version : VB problem


civil
11-06-2011, 02:10 AM
hi, im new in VB programing, so I need some help...pls help me because I have exam from this in a week, and I dont know the basics...
Every time I try to run this program :

Dim x as double, y as double
x=Inputbox("x=")
if x<-1 then
y=0
elseif x<0 then
y=2*x+2
elseif x<5 then
y=x^2-3*x+4
else
y=8
end if
msgbox("for x=" &x& "y=" &y)
End sub

Programme says "Compile error- Expected list separator or )"

what does that mean?? Where is error in my programme...

p.s. sorry for my bad english, hope you understand whats my problem

vbaInet
11-06-2011, 03:52 AM
You need to space out this bit:
msgbox("for x=" & x & "y=" &y)

civil
11-15-2011, 11:32 PM
tnx a lot!

vbaInet
11-16-2011, 01:31 AM
You're welcome!