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: 13
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: 4
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
That would suggest that none of the cells have a blue font of RGB(0,0,255)
 
Upvote 0
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: 2
Upvote 0
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.
 
Upvote 0
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?
 
Upvote 0
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: 4
Upvote 0
Ok, that suggests that the text in the cell is only partially coloured, rather than the cell font colour being changed.
 
Upvote 0
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: 4
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,428
Messages
6,119,420
Members
448,895
Latest member
omarahmed1

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
Back
Top