Interior.color value is only showing 16777215 in the excel VBA

Invisibleman

New Member
Joined
Sep 16, 2015
Messages
13
Dear all,

I have a sheet with multiple colors, that I want to set the color value in. However, no matter what I do the result is always 16777215. And it's strange, that it's only from 1 sheet, that give me this same result no matter which color is selected. The coloring is not done by conditional formatting, but really filled with the colors, I copied from another sheet, where I created these colors.

The code I used, is the following, as it was only for temperary use, it's not the best coding, but still. The result is not what it should be. And I tried multiple ways. See also the picture, for the sheet and the code I have.

VBA Code:
Private Sub CommandButton1_Click()

Dim yyFN As Integer, fc, tc, s, t As String

s = Settings_ColorsCharts.Range("U1").Value

For yyFN = 3 To 203
    fc = Trim(UCase(s) & yyFN)
    tc = "S" & yyFN
    t = "T" & yyFN
    Settings_ColorsCharts.Range(tc).Value = fc
    Settings_ColorsCharts.Range(t).Value = Settings_ChartColors.Range(fc).Interior.Color
Next

End Sub

For now I did got the color code numbers thru another way, but as you can see in the T column, the colors are always the same but it should show the color number as it is mentioned in the S column.

But if anyone can help/explain to me, why the clor code isn't shown correctly, then this would highly appreciated.

Regards,
Hans
 

Attachments

  • Sheet and VBA.jpg
    Sheet and VBA.jpg
    139.1 KB · Views: 7

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Dear all,

Please ignore the question, as I just saw the problem. I reffered to the wrong sheet. Stupid me. I will need to rename to identify better.

Settings_ColorsCharts.Range(t).Value = Settings_ChartColors.Range(fc).Interior.Color

Regards,
Hans
 
Upvote 0
Solution

Forum statistics

Threads
1,224,815
Messages
6,181,135
Members
453,021
Latest member
Justyna P

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