Microsoft Office Spreadsheet 10 in userform

depcdivr

Active Member
Joined
Jan 21, 2008
Messages
350
Office Version
  1. 365
Platform
  1. Windows
I am getting frustrated.

I am trying to color code some cells in a Microsoft Office Spreadsheet 10 that is contained within a userform. For some reason my colors were not coming out right. I would use the hex color "FF0000" and expecting a shade of red but getting a shade of blue. I quickly realized that I needed to reverse the order of the colors.

Why does the userform use BGR for hex colors when the rest of the world used RGB?

I am also trying to change the color of the font in the individual cells but can not seem to find the correct code to do so? any suggestions?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
I just figured out the font color.

I used

Code:
With Me.records.Cells(y, 2)
                .Interior.Color = "000000"
                .Font.Color = "0000ff"
            End With
 
Upvote 0
RGB in Windows is always encoded like that. In the Immediate window, enter

Code:
? hex(rgb(1,2,3))
 
Upvote 0
I guess that I am just used to programming HTML which is opposite of Windows. Just another thing in this world to mess with my mind.
 
Upvote 0

Forum statistics

Threads
1,224,505
Messages
6,179,152
Members
452,891
Latest member
JUSTOUTOFMYREACH

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