VB problem (1 Viewer)

civil

New member
Local time
Today, 05:11
Joined
Nov 6, 2011
Messages
2
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

AWF VIP
Local time
Today, 13:11
Joined
Jan 22, 2010
Messages
26,374
You need to space out this bit:
Code:
 msgbox("for x=" [COLOR=Red]& x &[/COLOR] "y=" &y)
 

civil

New member
Local time
Today, 05:11
Joined
Nov 6, 2011
Messages
2
tnx a lot!
 

Users who are viewing this thread

Top Bottom