Hello,
Can someone take a look at some basic code I wrote and help me figure out what i'm doing wrong.
I would like for a person to enter 2 colors (red, blue or yellow) to make a new color.
If they choose any other color they get an error.
Sub colorMix()
Dim color1 As String
Dim color2 As String
color1 = InputBox("Enter the first color")
color2 = InputBox("Enter the second color")
If Not color1 = "Red" Then
MsgBox ("You can only enter Red, Blue, or Yellow")
End If
If Not color1 = "Blue" Then
MsgBox ("You can only enter Red, Blue, or Yellow")
End If
If Not color1 = "Yellow" Then
MsgBox ("You can only enter Red, Blue, or Yellow")
End If
If Not color2 = "Red" Then
MsgBox ("You can only enter Red, Blue, or Yellow")
End If
If Not color2 = "Blue" Then
MsgBox ("You can only enter Red, Blue, or Yellow")
End If
If Not color2 = "Yellow" Then
MsgBox ("You can only enter Red, Blue, or Yellow")
End If
If Color = "Red" And color2 = "Blue" Then
MsgBox ("The new color is Purple")
Else
If color1 = "Red" And color2 = "Yellow" Then
MsgBox ("The new color is orange")
Else
If color1 = "Blue" And color2 = "Yellow" Then
MsgBox ("The new color is Green")
End If
End If
End If
End Sub
Thank you very much
Bookmarks