I was testing the RGB color mechanic on excel. So I did the following.
sub paint()
red = 255
blue = 0
green = 0
Max = 48
For col = 1 To Max
For Row = 1 To Max
Cells(Row, col).Interior.Color = RGB(red - col * Int(256 / (Max * 2)) - Row * Int(256 / (Max * 2)), green + col * Int(256 / Max), blue + Row * Int(256 / Max))
Next Row
Next col
end sub
This makes an rgb chart on excel filling the interior color of every cell on a max x max square. It was just made as a test and I think it worked pretty well.. except when I decided to add the following lines of code:
Sub paint()
red = 255
blue = 0
green = 0
Max = 48
For col = 1 To Max
For Row = 1 To Max
Cells(Row, col).Interior.Color = RGB(red - col * Int(256 / (Max * 2)) - Row * Int(256 / (Max * 2)), green + col * Int(256 / Max), blue + Row * Int(256 / Max))
Next Row
Next col
red = 0
blue = 255
green = 255
Max = 48
For col = 1 To Max
For Row = 1 To Max
Cells(Row, col) = "*"
Cells(Row, col).Font.Color = RGB(red + col * Int(256 / (Max * 2)) + Row * Int(256 / (Max * 2)), green - col * Int(256 / Max), blue - Row * Int(256 / Max))
Next Row
Next col
End Sub
Then excel just refuses to go on. It says something about the max amount of fonts being reached or somethings.
Im ok with the second part as being a limit to excel, however I am looking for improvement on the first part, if possible.