In column A I have Question Number and 4 options..Correct answer is in green colour... I have extracted my answer... I need to match with that colour...
please help me on this
I think the solution requires VBA. This is not great coding but might provide a starting point.
Code:
Sub TestColor()
Dim cell As Range
Dim I As Integer, J As Integer
Dim c As Double
For Each cell In [A1:A60]
For I = 1 To 4
J = 12 + (I - 1) * 5
c = cell.Characters(Start:=J, Length:=1).Font.Color
If c = 4172854 Then
cell.Offset(0, 4).Value = "Correct option is " & I
End If
Next I
Next cell
End Sub
It relies on finding the numbers at specific location in each string and places any result it finds in column E.
Function colour(rng As Range) As String
Dim r$
c$ = rng.Text
For i& = 1 To VBA.Len(c)
If rng.Characters(i, 1).Font.Color = 4172854 Then r = r & VBA.Mid(c, i, 1)
Next
colour = Trim(Left(r, 1))
End Function