how to solve too many different cells formats?

jackni

Board Regular
Joined
Feb 10, 2011
Messages
73
Hi, everyone,
I want to show all kinds of colors (256*256*256=16,777,216) in one Excel worksheet. The VBA code as follows:
Dim i, j, k, i1
Sub a()
Sheet1.UsedRange.Clear
i1 = 1
For i = 0 To 255
For j = 0 To 255
For k = 0 To 255
Cells(i1).Interior.Color = RGB(i, j, k)
Cells(i1) = Str(i) & " " & Str(j) & " " & Str(k)
i1 = i1 + 1
Next
Next
Next
End Sub

When I run the sub, here incounter "too many different cells formats".Can Excel extend memory to solve the problem. Thank you very much!!!
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
From here: https://support.office.com/en-gb/ar...67c00b05040f?ui=en-US&rs=en-GB&ad=GB&fromAR=1

Your code won't work as you exceed the number of rows
Worksheet size1,048,576 rows by 16,384 columns

<tbody>
</tbody>
Colors in a workbook16 million colors (32 bit with full access to 24 bit color spectrum)

<tbody>
</tbody>
Unique cell formats/cell styles64,000

<tbody>
</tbody>

Why on earth would you want to show 17 million colours??

That's way too many for a person to review.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,937
Members
449,094
Latest member
teemeren

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