The title probably isn't very well worded
I have a worksheet with a macro which formats a cell with the RGB values from the previous 3 cells.
So A1 will have the R value (0 - 255), B1 will have the G value (also 0 - 255) & C1 will have the B value (0 - 255)
I have a macro in D1 which will look up the 3 cells to the left &, if they contain valid numbers, will format that cell with the correct RGB colour.
This just works for 1 cell at a time.
I'd like it to repeat automatically until there is no more valid data in columns A, B or C.
Perhaps I should mention that the workshhet I am working on has about 135,000 rows so I need the macro to run 135,000 times (oe else I'm going to have to press CTRL Z 135,000 times which doesn't bear thinking about)
This is the macro
Sub Color()
Dim R As Integer, G As Integer, B As Integer
R = ActiveCell.Offset(0, -3).Value
G = ActiveCell.Offset(0, -2).Value
B = ActiveCell.Offset(0, -1).Value
ActiveCell.Interior.Color = RGB(R, G, B)
End Sub
I probably don't have to tell you that I'm very much a beginner at this.
Kind regards
Larry
I have a worksheet with a macro which formats a cell with the RGB values from the previous 3 cells.
So A1 will have the R value (0 - 255), B1 will have the G value (also 0 - 255) & C1 will have the B value (0 - 255)
I have a macro in D1 which will look up the 3 cells to the left &, if they contain valid numbers, will format that cell with the correct RGB colour.
This just works for 1 cell at a time.
I'd like it to repeat automatically until there is no more valid data in columns A, B or C.
Perhaps I should mention that the workshhet I am working on has about 135,000 rows so I need the macro to run 135,000 times (oe else I'm going to have to press CTRL Z 135,000 times which doesn't bear thinking about)
This is the macro
Sub Color()
Dim R As Integer, G As Integer, B As Integer
R = ActiveCell.Offset(0, -3).Value
G = ActiveCell.Offset(0, -2).Value
B = ActiveCell.Offset(0, -1).Value
ActiveCell.Interior.Color = RGB(R, G, B)
End Sub
I probably don't have to tell you that I'm very much a beginner at this.
Kind regards
Larry