Hi
I have the below code which checks data and where necessary, creates a new line.
This was created for me, so I dont know what to use to fill cells with colours?
Hope u can help
Thx
Darin
I have the below code which checks data and where necessary, creates a new line.
This was created for me, so I dont know what to use to fill cells with colours?
Code:
Sub AdjustData()
Dim LastUsedRow As Long
Dim i As Long
Dim j As Long
Application.ScreenUpdating = False
With Worksheets("Sheet1")
LastUsedRow = .Cells(65536, 1).End(xlUp).Row
If LastUsedRow > 1 Then
i = 2
Do
If .Cells(i, 2).Value = 1 And .Cells(i, 3) > 37.5 Then
j = i + 1
.Cells(j, 1).EntireRow.Insert
.Cells(j, 1).Value = .Cells(i, 1).Value
.Cells(j, 2).Value = 2
--------------------------------------------
[b][COLOR=red] I would like to fill .Cells(j, 2) and .Cells(j, 3) with yellow[/color][/b]
------------------------------------
.Cells(j, 3).Value = .Cells(i, 3).Value - 37.5
.Cells(i, 3) = 37.5
.Cells(j, 4).Value = .Cells(i, 4).Value
i = j
LastUsedRow = LastUsedRow + 1
End If
i = i + 1
Loop Until i > LastUsedRow
End If
End With
Application.ScreenUpdating = True
End Sub
Hope u can help
Thx
Darin