text color is not correctly returned with VBA

mastersesci

New Member
Joined
Feb 10, 2011
Messages
7
I have been working on a project with thousands of rows of multiple choice questions. I was basically creating an answer key by identifying which choice was in red font/text. However when I ran a macro to work through all of the rows outputting the font color values into some temporary columns, I got weird results.
Here is a link to a much smaller subset of the file for you to look at that has the temporary columns still located to the right of the original data.
https://app.box.com/s/gnnpeyb0jixpfx4azmjec90chmgc8stg


Any idea why this is not returning the expected results?
I have already checked to make sure there are no conditional formatting rules for the entire worksheet.
The person who provided me the data could not tell me how it was produced/exported

The code I was using to create the output in the temp rows was:

Code:
Sub code1()
Dim x as Long
With ThisWorkbook.Sheets("DATA")
For x = 3 To 15




Range("L" & x).Value = Range("D" & x).DisplayFormat.Font.Color
Range("M" & x).Value = Range("E" & x).DisplayFormat.Font.Color
Range("N" & x).Value = Range("F" & x).DisplayFormat.Font.Color
Range("O" & x).Value = Range("G" & x).DisplayFormat.Font.Color


Range("K" & x).Value = Application.WorksheetFunction.CountIf(Range("L" & x).Resize(1, 4), 0)


Next x


End With
End Sub
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
IaU3xmg.jpg
here is a screen capture of some of the data and macro output
IaU3xmg.jpg


https://pasteboard.co/IaU3xmg.jpg
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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