A VBA Error

P

Phil K

I'm trying to learn VBA and use it in PPT (PPT 2003 SP3)... I get the
following Error ;

Compile Error
Else without If

when I run the following

Private Sub CommandButton2_Click()
'Answer
Label2.Caption = Format((8.34 * Flow * (TS / 100) * (VS / 100)), "##")
Label6.Caption = "Lbs/Day"
If TextBox1 = Label2 Then MsgBox ("Correct")
Else
MsgBox ("Wrong .. Click on Solution Button to help in how")
End If

End Sub

Any help would be appreciated
 
S

Shyam Pillai

Press <ENTER> after the 'Then'

Private Sub CommandButton2_Click()
'Answer
Label2.Caption = Format((8.34 * Flow * (TS / 100) * (VS / 100)), "##")
Label6.Caption = "Lbs/Day"

If TextBox1 = Label2 Then
MsgBox ("Correct")
Else
MsgBox ("Wrong .. Click on Solution Button to help in how")
End If

End Sub


Regards,
Shyam Pillai
 
P

Phil K

Thanks Shyam..



Shyam Pillai said:
Press <ENTER> after the 'Then'

Private Sub CommandButton2_Click()
'Answer
Label2.Caption = Format((8.34 * Flow * (TS / 100) * (VS / 100)), "##")
Label6.Caption = "Lbs/Day"

If TextBox1 = Label2 Then
MsgBox ("Correct")
Else
MsgBox ("Wrong .. Click on Solution Button to help in how")
End If

End Sub


Regards,
Shyam Pillai
 

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