A
Also
(Excel 2000)
OK,Really wanted conditional formatting with 5 options but failing that have
created a Macro to do the colouring for me:
----------
Sub colourit()
'Colour it
If aai2004 >= aci2004 Then
abi2004.Select
With Selection.Interior
'Light orange
.ColorIndex = 3
.Pattern = xlSolid
End With
ElseIf Iaai2004 >= adi2004 Then
abi2004.Select
With Selection.Interior
'Light orange
.ColorIndex = 45
.Pattern = xlSolid
End With
ElseIf aai2004 >= aei2004 Then
abi2004.Select
With Selection.Interior
'Light orange
.ColorIndex = 6
.Pattern = xlSolid
End With
ElseIf aai2004 >= afi2004 Then
abi2004.Select
With Selection.Interior
'Light orange
.ColorIndex = 36
.Pattern = xlSolid
End With
Else: abi2004.Select
Selection.Interior.ColorIndex = xlNone
End If
End Sub
----------
However, I want to change the cell ranges each time so they are set using:
----------
Sub colset()
'Set ranges for colour up (round one)
Set aai2004 = Range("D5")
Set abi2004 = Range("D5,D27")
Set aci2004 = Range("D47")
Set adi2004 = Range("D48")
Set aei2004 = Range("D49")
Set afi2004 = Range("D50")
colourit
End Sub
----------
Of course it doesn't work as it can't read the variables...
And I can't set the globally as I want to set it the next time round as:
----------
Set aai2004 = Range("F5")
Set abi2004 = Range("F5,F27")
Set aci2004 = Range("F47")
Set adi2004 = Range("F48")
Set aei2004 = Range("F49")
Set afi2004 = Range("F50")
----------
I could do it if I understood loops to just increment two columns each time
(e.g. D to F) for 8 loops. But not sure how.
But as you can imagine, unless I try to tidy up the calls etc it's going to
become very large very quickly.
Any thoughts on how I could make this work?...
At the moment I am ending up coding in Word and using search and replace!
All help/comments/being called an idiot for long coding (and then a
suggestion how to change it) gratefully received.
OK,Really wanted conditional formatting with 5 options but failing that have
created a Macro to do the colouring for me:
----------
Sub colourit()
'Colour it
If aai2004 >= aci2004 Then
abi2004.Select
With Selection.Interior
'Light orange
.ColorIndex = 3
.Pattern = xlSolid
End With
ElseIf Iaai2004 >= adi2004 Then
abi2004.Select
With Selection.Interior
'Light orange
.ColorIndex = 45
.Pattern = xlSolid
End With
ElseIf aai2004 >= aei2004 Then
abi2004.Select
With Selection.Interior
'Light orange
.ColorIndex = 6
.Pattern = xlSolid
End With
ElseIf aai2004 >= afi2004 Then
abi2004.Select
With Selection.Interior
'Light orange
.ColorIndex = 36
.Pattern = xlSolid
End With
Else: abi2004.Select
Selection.Interior.ColorIndex = xlNone
End If
End Sub
----------
However, I want to change the cell ranges each time so they are set using:
----------
Sub colset()
'Set ranges for colour up (round one)
Set aai2004 = Range("D5")
Set abi2004 = Range("D5,D27")
Set aci2004 = Range("D47")
Set adi2004 = Range("D48")
Set aei2004 = Range("D49")
Set afi2004 = Range("D50")
colourit
End Sub
----------
Of course it doesn't work as it can't read the variables...
And I can't set the globally as I want to set it the next time round as:
----------
Set aai2004 = Range("F5")
Set abi2004 = Range("F5,F27")
Set aci2004 = Range("F47")
Set adi2004 = Range("F48")
Set aei2004 = Range("F49")
Set afi2004 = Range("F50")
----------
I could do it if I understood loops to just increment two columns each time
(e.g. D to F) for 8 loops. But not sure how.
But as you can imagine, unless I try to tidy up the calls etc it's going to
become very large very quickly.
Any thoughts on how I could make this work?...
At the moment I am ending up coding in Word and using search and replace!
All help/comments/being called an idiot for long coding (and then a
suggestion how to change it) gratefully received.