Formula Help Needed

ironsides

Well-known Member
Joined
Aug 12, 2002
Messages
575
Sub ColourNameChanges()
Dim c As Range
Dim sLast As String

'clear current formats
Range(Range("A3"), Range("G65536").End(xlUp).Offset(0, 43)).Interior.ColorIndex = xlNone
'highlight changes
For Each c In Range("G:G").SpecialCells(xlCellTypeConstants, xlTextValues)
If c.Row <= 3 Then 'in case there is a value before row 3...
sLast = c.Value
Else
If c.Value = sLast Then
'do nothing
Else
Cells(c.Row - 1, 1).Resize(1, 90).Interior.ColorIndex = 6 'yellow
sLast = c.Value
End If
End If
Next c
End Sub

I'm using this formula successfully. I want to change the color

Is the 6 'yellow specification that needs to be changed?
If not what is?

What are the specifications for

Medium Blue
Gray
Brown or any others?
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Turn on Macro Recorder and change a cell to the color in question.
Stop the recorder and view the resultant code. You will see the color number there.
 
Upvote 0
If you run this macro on a blank sheet, you'll get a list of numbers in column A and the adjacent cells in Column B showing the corresponding color index...
Code:
Sub CreateColorIndexList()
****Dim i As Integer
****For i = 1 To 56
********Cells(i, 1).Value = i
********Cells(i, 2).Interior.ColorIndex = i
****Next i
End Sub
 
Upvote 0

Forum statistics

Threads
1,203,139
Messages
6,053,724
Members
444,681
Latest member
Nadzri Hassan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top