Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
can you make this faster?
here is the code... is there a quicker way to do this?
Private Sub Worksheet_Calculate() Dim Target As Range For Each Target In Range("p4:p34") If Target.Value = True Then Cells(Target.Row, "G").Resize(1, 24).Interior.ColorIndex = 15 End If If Target.Value = False Then Cells(Target.Row, "G").Resize(1, 24).Interior.ColorIndex = xlNone End If Next End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
can you make this faster?
Hi John,
John wrote: here is the code... is there a quicker way to do this? Private Sub Worksheet_Calculate() Dim Target As Range For Each Target In Range("p4:p34") If Target.Value = True Then Cells(Target.Row, "G").Resize(1, 24).Interior.ColorIndex = 15 End If If Target.Value = False Then Cells(Target.Row, "G").Resize(1, 24).Interior.ColorIndex = xlNone End If Next End Sub This is the perfect situation for conditional formatting: http://www.contextures.com/xlCondFormat03.html -- Regards, Jake Marx www.longhead.com [please keep replies in the newsgroup - email address unmonitored] |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
can you make this faster?
Rewriting with the same If...Then structure gives me this... didn't
check the working (perhaps the set x... will give problems, just try it) Private Sub Worksheet_Calculate() Dim Target As Range set x = Cells(Target.Row, "G").Resize(1, 24).Interior.ColorIndex For Each Target In Range("p4:p34") If Target.Value = True Then x = 15 else x = xlNone End If Next End Sub Bye Baj |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Make Excel Work faster | New Users to Excel | |||
How Can I make excel go faster | Excel Programming | |||
make my vba/excel program faster | Excel Programming | |||
make my vba/excel program faster | Excel Programming | |||
make my VBA program faster | Excel Programming |