Jane has attended:
Word VBA course
Word VBA course
Word vba
am preparing a template and am asking a question which i need a message box to appear. i have inserted the following code
Private Sub EUVAT_Click()
If BillAmounts.EUVAT = Yes Then
Sub NewMessage()
MsgBox("Is the Client VAT number shown above correctly?", vbYesNo) = vbYes
End If
End Sub
when i click yes in the template BillAmounts gets highlighted and error Expected End Sub.
I would be grateful for some help, I havent done any vba since training in June !
RE: word vba
Hi Jane
The error message is due to the fact you did a Sub Newmessage in the middle of the if statement. Try the following code istead:
Private Sub EUVAT_Click()
Dim Reply As Byte
If BillAmounts.EUVAT = Yes Then
Reply = MsgBox("Is the Client VAT number shown above correctly?", vbYesNo)
If Reply = vbYes Then
'Code for Yes reply
Else
'Code for No reply
End If
End If
End Sub
Hope this helps
Carlos