Ading color to difrent cells
Hi everybody
I have a column that contains diferent time intervals and I want t make a macro or VBA to give to each diferent time interval diferen color Exampl 18:00-18:1 18:00-18:1 18:10-18:2 The "18:00-18:10" should be in one colo The "18:10-18:20" should be in another color thank -------- Message sent via www.excelforums.com |
Ading color to difrent cells
Hi,
activecell.interior.colorindex = 5 'red copy this code into an blank xl file to find all of the color indexes Sub macGetColors() Sheets("Sheet1").Select Range("B2").Select Set ci = Range("A1") ci.Value = 1 Set c = Range("B2") Do Until ci 56 Set c2 = c.Offset(1, 0) Set cnum = c.Offset(0, 1) c.Interior.ColorIndex = ci.Value c.Offset(0, 1) = ci.Value ci.Value = ci.Value + 1 Set c = c2 c.Select Loop End Sub -----Original Message----- Hi everybody, I have a column that contains diferent time intervals and I want to make a macro or VBA to give to each diferent time interval diferent color. Example 18:00-18:10 18:00-18:10 18:10-18:20 The "18:00-18:10" should be in one color The "18:10-18:20" should be in another color. thanks --------- Message sent via www.excelforums.com . |
Ading color to difrent cells
|
All times are GMT +1. The time now is 11:29 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com