[COLOR=Navy]Sub [/COLOR]FattyColourChange2()
[COLOR=Navy]Dim [/COLOR]dCell [COLOR=Navy]As Integer[/COLOR], rowStart [COLOR=Navy]As long[/COLOR]
[COLOR=Navy]Dim [/COLOR]ws [COLOR=Navy]As [/COLOR]Worksheet
[COLOR=DarkGreen]'Define the worksheet name[/COLOR]
[COLOR=Navy]Set [/COLOR]ws = Worksheets("Sheet1")[COLOR=DarkGreen] 'change here and only need to change it once[/COLOR]
[COLOR=DarkGreen]'you can change this to whatever row you want the loop to start from[/COLOR]
rowStart = 1 [COLOR=DarkGreen]'starts from the first row in the sheet[/COLOR]
[COLOR=DarkGreen]'loop from 1 to 35[/COLOR]
[COLOR=Navy]For [/COLOR]i = 1 [COLOR=Navy]To [/COLOR]35
[COLOR=DarkGreen] 'check that the cells contain numbers[/COLOR]
[COLOR=Navy]If [COLOR=Black]IsNumeric[/COLOR][/COLOR](ws.Cells(i + rowStart - 1, 4).Value) [COLOR=Navy]And [/COLOR]IsNumeric(ws.Cells(i + rowStart - 1, 3).Value) [COLOR=Navy]Then[/COLOR]
[COLOR=DarkGreen]'put 5% of the value of cell in column D [/COLOR]
dCell = ws.Cells(i + rowStart - 1, 4).Value / 100 * 5
[COLOR=DarkGreen]'compare and then change the colour of the cell in column C[/COLOR]
[COLOR=Navy]If [/COLOR]ws.Cells(i + rowStart - 1, 3).Value > dCell [COLOR=Navy]Then[/COLOR]
ws.Cells(i + rowStart - 1, 3).Interior.ColorIndex = 3
Else
ws.Cells(i + rowStart - 1, 3).Interior.ColorIndex = 6
[COLOR=Navy]End If[/COLOR]
[COLOR=Navy]End If[/COLOR]
[COLOR=Navy]Next [/COLOR]i
[COLOR=Navy]End Sub[/COLOR]