How to set specific value if font is colored

stillg

New Member
Joined
Feb 1, 2021
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
Hello.
I need some help.
I have a test with 850 questions. Each row consists of starting from row 3 /number of the question (A3), the question itself(B3), Answer 1(C3),Answer 2(D3), Answer 3(E3), Answer 4(F3), Correct answer (G3).
The right answer among all 4 available answers is colored in BRG(0.0.255) Blue.
If the right answer is Answer 3/ colored in BRG(0.0.255) Blue/ - to appear 3 in Correct answer column G3.
If the right answer is Answer 4/ colored in BRG(0.0.255) Blue/ - to appear 4 in Correct answer column G3.
So I can apply this condition to all 850 questions.

Thank to all.
 

Attachments

  • Test 850.jpg
    Test 850.jpg
    163.5 KB · Views: 10

stillg

New Member
Joined
Feb 1, 2021
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
In that case use the code supplied by Saurabhj but change "Sheet1" to "Table 1"
The script runs without any error, but there is no result in my table.
 

Attachments

  • Test 850 2.jpg
    Test 850 2.jpg
    152.9 KB · Views: 1

Some videos you may like

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,526
Office Version
  1. 365
Platform
  1. Windows
That would suggest that none of the cells have a blue font of RGB(0,0,255)
 

stillg

New Member
Joined
Feb 1, 2021
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
In that case use the code supplied by Saurabhj but change "Sheet1" to "Table 1"
The code runs without an error , but the is no any change or result in my table.
 

Attachments

  • Test 850 2.jpg
    Test 850 2.jpg
    152.9 KB · Views: 0

stillg

New Member
Joined
Feb 1, 2021
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
That would suggest that none of the cells have a blue font of RGB(0,0,255)
Yes, You're absolutely right. Now I tried to change the font color to RGB(0.0.255) by hand and the code started to work. Now the question is , how I can get the actual color of the font.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,526
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

If you select a cell with the blue font & run this
VBA Code:
Sub check()
   MsgBox ActiveCell.Font.Color
End Sub
what does it say?
 

stillg

New Member
Joined
Feb 1, 2021
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
If you select a cell with the blue font & run this
VBA Code:
Sub check()
   MsgBox ActiveCell.Font.Color
End Sub
what does it say?
I guess everything with the Font color is messed up with the conversion from PDF to Excel.
 

Attachments

  • Test 850 2.jpg
    Test 850 2.jpg
    138.4 KB · Views: 2

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,526
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

Ok, that suggests that the text in the cell is only partially coloured, rather than the cell font colour being changed.
 

stillg

New Member
Joined
Feb 1, 2021
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
Ok, that suggests that the text in the cell is only partially coloured, rather than the cell font colour being changed.
All the text in the cell with the correct answer is colored in blue, but I don't know why it can not get the actual color. I tried to get the color by selecting the text, go to Font colors, select More colors and finally select Custom.
 

Attachments

  • Test 850 3.jpg
    Test 850 3.jpg
    184.3 KB · Views: 1

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,526
Office Version
  1. 365
Platform
  1. Windows
Can you upload the file to a share site, such as One Drive or Google Drive? If so mark for sharing & post the link to the thread.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,529
Messages
5,625,341
Members
416,096
Latest member
forevans

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top