Thanks! I used the code which you gave me and the test validate button turned out to be good for valid BOGO commands, but I still can't get it to detect invalid BOGO commands. I tried changing the "=" signs to "<>" signs and then setting it to Validate = false, but it just makes a runtime error.
Also, I don't know what they mean by intCurRow as the parameter. How would I implement that into the code?
This is what they gave me:
You should implement Validate by writing code between the Function Validate and End Function lines. The Validate function is used to check to see if the current instruction is a valid BOGO instruction. Using the function's parameter intCurRow, which holds the row of the instruction we're attempting to validate, check each of the three parts of the instruction (Direction, Distance, Color) to see that they conform to the BOGO specification described in the Introduction (Table 1). If any part of the instruction does not conform to the table, change the background color of all three cells to red and return False. Otherwise, return True.
The syntax for changing the background color of a cell to red is
Cells(intMyRow, intMyCol).Interior.Color = vbRed
The valid commands for BOGO are:
Direction
U = UP
D = DOWN
L = LEFT
R = RIGHT
Distance
Any integer between 1 and 20 inclusive
Color
BLACK
RED
GREEN
YELLOW
BLUE
MAGENTA
CYAN
WHITE
I know I'm asking way too much of you guys, but I simply don't know what they're asking me to do, besides write code between the given validate function, using intcurRow which is the parameter that holds the row which we choose to validate, checking to see if the commands are valid, checking each of the 3 parts..distance, color and direction.
Just a starter code for maybe distance to check if it's valid meaning between 1 and 20, using intcurRow would help..then I can just change the code to check for color and distance..
thanks again.