bocanegra
07-22-2007, 06:44 AM
Hi
In the active cell I have this:
The _hite _one is _uried _ehind the _ardrobe
I have three buttos (button B; button V and button W) to put one letter each time I clic one button. When I clic one button, it fills the first dash with the letter of the button (b, v or w) and then I call this code to check if the clicked letter is ok or not. When I clic again, it fills the second dash with the letter of the button and so on...
wOk contains the correct sentence and wTest contains the sentence that we fill with the letters.
wTest = The _hite _one is _uried _ehind the _ardrobe
wOk = The wite bone is buried behind the wardrobe
I have this code:
'We paint the hits in green and the failures in red
wTest = UCase(Mid(sWord, Pos, 1))
wOk = Cells(iRow, 4).Value
wOk = UCase(Mid(wOk, Pos, 1))
If wTest = wOk Then
With ActiveCell.Characters(Start:=Pos, Length:=1).Font
.Color = RGB(36, 182, 36) 'GREEN (0K)
End With
Else
With ActiveCell.Characters(Start:=Pos, Length:=1).Font
.Color = RGB(255, 0, 0) 'RED (failures)
End With
End If
PROBLEM:
I clic two times... for example: w and v buttons. When I clic w button, the w color is green, because the letter is ok
The White _one is _uried _ehind the _ardrobe
When I clic the second letter (v) must be painted in red, because is an error
The White Vone is _uried _ehind the _ardrobe
In this case it change the colors of the sentence to black
execept de clicked letter
The White Vone is _uried _ehind the _ardrobe
it the first letter is green, the sentence chages to green, execept de clicked letter; if its ret, changes to red...
Is somebody able to help me to solve this mess?
In the active cell I have this:
The _hite _one is _uried _ehind the _ardrobe
I have three buttos (button B; button V and button W) to put one letter each time I clic one button. When I clic one button, it fills the first dash with the letter of the button (b, v or w) and then I call this code to check if the clicked letter is ok or not. When I clic again, it fills the second dash with the letter of the button and so on...
wOk contains the correct sentence and wTest contains the sentence that we fill with the letters.
wTest = The _hite _one is _uried _ehind the _ardrobe
wOk = The wite bone is buried behind the wardrobe
I have this code:
'We paint the hits in green and the failures in red
wTest = UCase(Mid(sWord, Pos, 1))
wOk = Cells(iRow, 4).Value
wOk = UCase(Mid(wOk, Pos, 1))
If wTest = wOk Then
With ActiveCell.Characters(Start:=Pos, Length:=1).Font
.Color = RGB(36, 182, 36) 'GREEN (0K)
End With
Else
With ActiveCell.Characters(Start:=Pos, Length:=1).Font
.Color = RGB(255, 0, 0) 'RED (failures)
End With
End If
PROBLEM:
I clic two times... for example: w and v buttons. When I clic w button, the w color is green, because the letter is ok
The White _one is _uried _ehind the _ardrobe
When I clic the second letter (v) must be painted in red, because is an error
The White Vone is _uried _ehind the _ardrobe
In this case it change the colors of the sentence to black
execept de clicked letter
The White Vone is _uried _ehind the _ardrobe
it the first letter is green, the sentence chages to green, execept de clicked letter; if its ret, changes to red...
Is somebody able to help me to solve this mess?