LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Colour specific cell based on 2 other cell values

Hi, I've got spreadsheet with a list of clients, each client having
their own row.
I have recorded a macro which goes through each client and fills in
colour on the Q column if they have a "Yes" on either column V or F.
The clients are numbered on column A (I use the last client to
determine how far down to go). The problem I have is that my macro is
a bit too slow for my liking. Any ideas on an improvement?

Dim clients As Variant
Dim distance As Variant


Range("A2").Select
Selection.End(xlDown).Select
distance = 0
clients = ActiveCell
Range("F3").Select
Do Until distance = clients
If ActiveCell = "Yes" Then
ActiveCell.Offset(0, 11).Range("A1").Select
With Selection.Interior
.ColorIndex = 4
.Pattern = xlSolid
End With
ActiveCell.Offset(1, -11).Range("A1").Select
Else
ActiveCell.Offset(0, 16).Range("A1").Select
If ActiveCell = "Yes" Then
ActiveCell.Offset(0, -5).Range("A1").Select
With Selection.Interior
.ColorIndex = 4
.Pattern = xlSolid
End With
ActiveCell.Offset(1, -11).Range("A1").Select
Else
ActiveCell.Offset(1, -16).Range("A1").Select
End If
End If
distance = distance + 1
Loop
End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
cell vlue based on cell back colour Esradekan Excel Worksheet Functions 7 April 3rd 10 05:49 PM
Fill cell colour based on input in another cell Dan Wood[_2_] Excel Worksheet Functions 2 August 20th 09 06:28 AM
Default colour in cell based on specific entry KCG Excel Worksheet Functions 4 August 5th 07 09:26 AM
change current cell colour based on the value of adjacent cell on other worksheet Rits Excel Programming 2 November 23rd 06 11:57 AM
Conditional Format with VBA - Interior Colour of cell based on value from in-cell dropdown Steve[_52_] Excel Programming 5 June 15th 04 11:45 AM


All times are GMT +1. The time now is 02:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"