-
Her's an outline. It doesn't meet all your criteria, but is maybe a way forward
[VBA]Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Column
Case 1
Select Case Target.Value
Case Is > 30000000
Target.Offset(, 7).Interior.ColorIndex = 8
Case Is >= 1000000
Target.Offset(, 3).Interior.ColorIndex = 8
Case Is >= 1000
Target.Offset(, 2).Interior.ColorIndex = 8
End Select
Case 2
Select Case Target.Value
Case Is > 100000000
Infill Target, 5
Case Is <= 100000000
Infill Target, 4
Case Is >= 25000000
Infill Target, 3
Case Is >= 1000000
Infill Target, 2
End Select
End Select
End Sub
Private Sub Infill(Target As Range, x As Long)
Target.Offset(, x).Interior.ColorIndex = 8
For i = x - 1 To 0 Step -1
With Target.Offset(, i)
If .Interior.ColorIndex = xlNone Then
.Interior.ColorIndex = 8
Else
Exit Sub
End If
End With
Next
End Sub[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules