Hiya,
I've got a repetition structure with lots of double selection inside it. Is there a quicker way to write this (i.e. can I put a while within a for loop?) and what is the syntax?
I've got a repetition structure with lots of double selection inside it. Is there a quicker way to write this (i.e. can I put a while within a for loop?) and what is the syntax?
Code:
For Each cl In r
If cl.Value = "Client vs MAINFRAME DO NOT MATCH!" Then
cl.Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Interior.ColorIndex = 6
ElseIf cl.Value = "NO Client PRICE FOR THIS PRODUCT!" Then
cl.Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Interior.ColorIndex = 6
ElseIf cl.Value = "MISTMATCH!" Then
cl.Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Interior.ColorIndex = 6
ElseIf cl.Value = "MISMATCH: ACCMGR PENDING" Then
cl.Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Interior.ColorIndex = 6
ElseIf cl.Value = "MISSING FROM Client: PLEASE ADVISE THE CLIENT!" Then
cl.Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Interior.ColorIndex = 6
ElseIf cl.Value = "NO RECORDS EXIST ON Client!" Then
cl.Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Interior.ColorIndex = 6
ElseIf cl.Value = "NO RECORDS ON MAINFRAME!" Then
cl.Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Interior.ColorIndex = 6
ElseIf cl.Value = "PLEASE VALIDATE WITH ACCMGR!" Then
cl.Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Interior.ColorIndex = 6
ElseIf cl.Value = "POSSIBLE MATCH: Client IS FACTOR OR MULTIPLE OF MFRAME" Then
cl.Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Interior.ColorIndex = 34
End If
Next cl