I have a waiting list that I want to colour usig a macro, based on certain criteria.
What I have already is:
PatientOffset = 0
Do
Wait = Range("H2").Offset(PatientOffset, 0).Value
If Wait > 31 Then
Range("H2").Offset(PatientOffset, 0).EntireRow.Interior.ColorIndex = 3 ' RED
ElseIf Wait > 25 Then
Range("H2").Offset(PatientOffset, 0).EntireRow.Interior.ColorIndex = 46 ' AMBER
ElseIf Wait > 0 Then
Range("H2").Offset(PatientOffset, 0).EntireRow.Interior.ColorIndex = 43 ' GREEN
ElseIf Wait = " " Then
Range("H2").Offset(PatientOffset, 0).EntireRow.Interior.ColorIndex = 2 ' WHITE
ElseIf Wait Is Null Then
Range("H2").Offset(PatientOffset, 0).EntireRow.Interior.ColorIndex = 2 ' WHITE
End If
PatientOffset = PatientOffset + 1
Loop Until Range("H2").Offset(PatientOffset, 0).Value = ""
This isnt doing exaclty what I would like. Im ot sure what the offset fuction does.
I want to colour affecting rows where i column H the value is over 31 days when column K has the text beginnig with yes*(wildcard) or is blank or unkn* (wildcard)
If its over 31 days ad the text is No* (wildcard), leave white
If H is between 25 and 31, and yes*(wildcard) or blank or unkn* (wildcard) colour rows amber, if No* leave white
If between 0 and 25 and yes*(wildcard) or blank or unkn* (wildcard) colour green, if No in H, leave white
I want it to loop dow to the last record rather then the first blank, s soe are blank.
Can anyone tweak m macro? Thanks
What I have already is:
PatientOffset = 0
Do
Wait = Range("H2").Offset(PatientOffset, 0).Value
If Wait > 31 Then
Range("H2").Offset(PatientOffset, 0).EntireRow.Interior.ColorIndex = 3 ' RED
ElseIf Wait > 25 Then
Range("H2").Offset(PatientOffset, 0).EntireRow.Interior.ColorIndex = 46 ' AMBER
ElseIf Wait > 0 Then
Range("H2").Offset(PatientOffset, 0).EntireRow.Interior.ColorIndex = 43 ' GREEN
ElseIf Wait = " " Then
Range("H2").Offset(PatientOffset, 0).EntireRow.Interior.ColorIndex = 2 ' WHITE
ElseIf Wait Is Null Then
Range("H2").Offset(PatientOffset, 0).EntireRow.Interior.ColorIndex = 2 ' WHITE
End If
PatientOffset = PatientOffset + 1
Loop Until Range("H2").Offset(PatientOffset, 0).Value = ""
This isnt doing exaclty what I would like. Im ot sure what the offset fuction does.
I want to colour affecting rows where i column H the value is over 31 days when column K has the text beginnig with yes*(wildcard) or is blank or unkn* (wildcard)
If its over 31 days ad the text is No* (wildcard), leave white
If H is between 25 and 31, and yes*(wildcard) or blank or unkn* (wildcard) colour rows amber, if No* leave white
If between 0 and 25 and yes*(wildcard) or blank or unkn* (wildcard) colour green, if No in H, leave white
I want it to loop dow to the last record rather then the first blank, s soe are blank.
Can anyone tweak m macro? Thanks