G
Guest
I would like to show you the syntax for VBA I debugged successfully:
Dim strHours As String, strRate As String
Dim hours As Single, rate As Single, gross As Single
strHours = InputBox("Enter the hours")
strRate = InputBox("Enter the rate")
hours = Val(strHours) 'converts a string to a number
rate = Val(strRate)
gross = hours * rate
MsgBox ("The gross pay is " & Str(gross)) 'Str(gross) converts a number to
a string
Tax = Val(25 / 100 * gross)
NetPay = Val(gross - Tax)
Dim FirstName As String
FirstName = InputBox("Enter the First Name")
MsgBox "The First Name is John"
Dim LastName As String
LastName = InputBox("Enter the Last Name")
MsgBox "The Last Name is Smith"
Dim FullName As String
FullName = InputBox("Enter the First Name" + "Enter the Last Name")
MsgBox "The Full Name is John Smith"
The following syntax that was supposed to display the MsgBox "Pay details
for John Smith are Gross = 400, Tax = 100, Net = 300" is incorrect:
Gross = "Gross = (gross)" + Tax = "Tax = (Tax)" + NetPay = "NetPay =
(NetPay)"")
Yours Sincerely
Dim strHours As String, strRate As String
Dim hours As Single, rate As Single, gross As Single
strHours = InputBox("Enter the hours")
strRate = InputBox("Enter the rate")
hours = Val(strHours) 'converts a string to a number
rate = Val(strRate)
gross = hours * rate
MsgBox ("The gross pay is " & Str(gross)) 'Str(gross) converts a number to
a string
Tax = Val(25 / 100 * gross)
NetPay = Val(gross - Tax)
Dim FirstName As String
FirstName = InputBox("Enter the First Name")
MsgBox "The First Name is John"
Dim LastName As String
LastName = InputBox("Enter the Last Name")
MsgBox "The Last Name is Smith"
Dim FullName As String
FullName = InputBox("Enter the First Name" + "Enter the Last Name")
MsgBox "The Full Name is John Smith"
The following syntax that was supposed to display the MsgBox "Pay details
for John Smith are Gross = 400, Tax = 100, Net = 300" is incorrect:
Gross = "Gross = (gross)" + Tax = "Tax = (Tax)" + NetPay = "NetPay =
(NetPay)"")
Yours Sincerely