Hi All,
I am trying to create a Macro that would show all of the possible combinations of Red and Green.
Blue would stay the same. (0)
It should end being a grid of 256 x 256 or 65,536
I tried the code below and I get the first column, but the next step just goes across row 1.
Please help.
------------
Sub Color256x256()
' Make a Grid of all possible combinations or Red and Green. Blue stays the same. Should be 65,536 colors.
' Zenwood - 9.2.17
B = 0
For G = G + 0 To 255
' Draw a column of Red
For R = R + 0 To 255
ActiveCell.Interior.Color = RGB(R, G, B)
ActiveCell.Offset(1, 0).Select ' Move to next row
Next
' Add 1 to green and move to next column
Cells(1, ActiveCell.Column).Select ' move to top
ActiveCell.Offset(0, 1).Select ' Move to nect column
ActiveCell.Interior.Color = RGB(R, G, B)
Next
End Sub
I am trying to create a Macro that would show all of the possible combinations of Red and Green.
Blue would stay the same. (0)
It should end being a grid of 256 x 256 or 65,536
I tried the code below and I get the first column, but the next step just goes across row 1.
Please help.
------------
Sub Color256x256()
' Make a Grid of all possible combinations or Red and Green. Blue stays the same. Should be 65,536 colors.
' Zenwood - 9.2.17
B = 0
For G = G + 0 To 255
' Draw a column of Red
For R = R + 0 To 255
ActiveCell.Interior.Color = RGB(R, G, B)
ActiveCell.Offset(1, 0).Select ' Move to next row
Next
' Add 1 to green and move to next column
Cells(1, ActiveCell.Column).Select ' move to top
ActiveCell.Offset(0, 1).Select ' Move to nect column
ActiveCell.Interior.Color = RGB(R, G, B)
Next
End Sub