Skip to main content
edited body; edited title
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

Paint everything. [Messing around with Interior and font color] Making an RBG chart on Excel

I was testing the RGB color mechanic on excel. SoExcel, 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 rgbRBG chart on excelExcel 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.

I am looking for improvement, if possible.

Paint everything. [Messing around with Interior and font color]

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.

I am looking for improvement, if possible.

Making an RBG chart on Excel

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 RBG 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.

I am looking for improvement, if possible.

based on a comment, " please edit out the 2nd part which doesn't (can't) work."
Source Link
Moacir
  • 167
  • 2
  • 11

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.

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.

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.

I am looking for improvement, if possible.

Source Link
Moacir
  • 167
  • 2
  • 11

Paint everything. [Messing around with Interior and font color]

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.