0% found this document useful (0 votes)
35 views2 pages

If and and and Then: Msgboxstyle

The document contains code that compares the values in five text boxes (TextBox6-TextBox10) to determine the highest and lowest scores. It displays the name and score of the highest and lowest values in message boxes using If/ElseIf statements.

Uploaded by

Sherwin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views2 pages

If and and and Then: Msgboxstyle

The document contains code that compares the values in five text boxes (TextBox6-TextBox10) to determine the highest and lowest scores. It displays the name and score of the highest and lowest values in message boxes using If/ElseIf statements.

Uploaded by

Sherwin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 2

If TextBox6.Text > TextBox7.Text And TextBox6.Text > TextBox8.

Text And
TextBox6.Text > TextBox9.Text And TextBox6.Text > TextBox10.Text Then
MsgBox("The highest is:" & vbNewLine _
& "Name: " & TextBox1.Text & vbNewLine _
& "Score: " & TextBox6.Text _
, MsgBoxStyle.Information, Title:="Message")
ElseIf TextBox7.Text > TextBox6.Text And TextBox7.Text > TextBox8.Text And
TextBox7.Text > TextBox9.Text And TextBox7.Text > TextBox10.Text Then
MsgBox("The highest is:" & vbNewLine _
& "Name: " & TextBox2.Text & vbNewLine _
& "Score: " & TextBox7.Text _
, MsgBoxStyle.Information, Title:="Message")
ElseIf TextBox8.Text > TextBox6.Text And TextBox8.Text > TextBox7.Text And
TextBox8.Text > TextBox9.Text And TextBox8.Text > TextBox10.Text Then
MsgBox("The highest is:" & vbNewLine _
& "Name: " & TextBox3.Text & vbNewLine _
& "Score: " & TextBox8.Text _
, MsgBoxStyle.Information, Title:="Message")
ElseIf TextBox9.Text > TextBox6.Text And TextBox9.Text > TextBox7.Text And
TextBox9.Text > TextBox8.Text And TextBox9.Text > TextBox10.Text Then
MsgBox("The highest is:" & vbNewLine _
& "Name: " & TextBox4.Text & vbNewLine _
& "Score: " & TextBox9.Text _
, MsgBoxStyle.Information, Title:="Message")
ElseIf TextBox10.Text > TextBox6.Text And TextBox10.Text > TextBox7.Text
And TextBox10.Text > TextBox8.Text And TextBox10.Text > TextBox9.Text Then
MsgBox("The highest is:" & vbNewLine _
& "Name: " & TextBox5.Text & vbNewLine _
& "Score: " & TextBox10.Text _
, MsgBoxStyle.Information, Title:="Message")
End If

If TextBox6.Text < TextBox7.Text And TextBox6.Text < TextBox8.Text And


TextBox6.Text < TextBox9.Text And TextBox6.Text < TextBox10.Text Then
MsgBox("The lowest is:" & vbNewLine _
& "Name: " & TextBox1.Text & vbNewLine _
& "Score: " & TextBox6.Text _
, MsgBoxStyle.Information, Title:="Message")
ElseIf TextBox7.Text < TextBox6.Text And TextBox7.Text < TextBox8.Text And
TextBox7.Text < TextBox9.Text And TextBox7.Text < TextBox10.Text Then
MsgBox("The lowest is:" & vbNewLine _
& "Name: " & TextBox2.Text & vbNewLine _
& "Score: " & TextBox7.Text _
, MsgBoxStyle.Information, Title:="Message")
ElseIf TextBox8.Text < TextBox6.Text And TextBox8.Text < TextBox7.Text And
TextBox8.Text < TextBox9.Text And TextBox8.Text < TextBox10.Text Then
MsgBox("The lowest is:" & vbNewLine _
& "Name: " & TextBox3.Text & vbNewLine _
& "Score: " & TextBox8.Text _
, MsgBoxStyle.Information, Title:="Message")
ElseIf TextBox9.Text < TextBox6.Text And TextBox9.Text < TextBox7.Text And
TextBox9.Text < TextBox8.Text And TextBox9.Text < TextBox10.Text Then
MsgBox("The lowest is:" & vbNewLine _
& "Name: " & TextBox4.Text & vbNewLine _
& "Score: " & TextBox9.Text _
, MsgBoxStyle.Information, Title:="Message")
ElseIf TextBox10.Text < TextBox6.Text And TextBox10.Text < TextBox7.Text
And TextBox10.Text < TextBox8.Text And TextBox10.Text < TextBox9.Text Then
MsgBox("The lowest is:" & vbNewLine _
& "Name: " & TextBox5.Text & vbNewLine _
& "Score: " & TextBox10.Text _
, MsgBoxStyle.Information, Title:="Message")
End If

You might also like