Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 262
Default Changing the colors of a cell

I have been trying to use a macro to change the colors of a cell.. the first
change from default to pink is ok but then it will not change to another
color.

If t6 = yes Then
Range("t7:w7").Select
Selection.Interior.ColorIndex = 7
ElseIf u6 = no Then
Range("t7:w7").Select
Selection.Interior.ColorIndex = 2
ElseIf w6 = yes Then
Range("t7:w7").Select
Selection.Interior.ColorIndex = 4
Else:
Range("t7:w7").Select
Selection.Interior.ColorIndex = 2
End If
End Sub

Any ideas would be appreciated.... thanks for the help in the past
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Changing the colors of a cell



If Range("t6").Value = "yes" Then
Range("t7:w7").Interior.ColorIndex = 7
ElseIf Range("u6").Value = " no Then
Range("t7:w7").Interior.ColorIndex = 2
ElseIf Range("w6").Value = "yes Then
Range("t7:w7")..ColorIndex = 4
Else
Range("t7:w7").Interior.ColorIndex = 2
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Keith" wrote in message
...
I have been trying to use a macro to change the colors of a cell.. the

first
change from default to pink is ok but then it will not change to another
color.

If t6 = yes Then
Range("t7:w7").Select
Selection.Interior.ColorIndex = 7
ElseIf u6 = no Then
Range("t7:w7").Select
Selection.Interior.ColorIndex = 2
ElseIf w6 = yes Then
Range("t7:w7").Select
Selection.Interior.ColorIndex = 4
Else:
Range("t7:w7").Select
Selection.Interior.ColorIndex = 2
End If
End Sub

Any ideas would be appreciated.... thanks for the help in the past



Reply
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
Changing cell colors Joebeone Excel Discussion (Misc queries) 1 February 11th 10 07:17 PM
changing cell background colors with formulas postal vet Excel Worksheet Functions 5 October 30th 08 07:07 AM
Cell colors or text color changing when date in cell gets closer. Chase Excel Worksheet Functions 5 October 19th 06 08:57 AM
changing cell colors with formula sflcowboy78 Excel Worksheet Functions 2 October 2nd 05 01:19 AM
Cell contents changing colors Barmaley Excel Programming 0 July 8th 03 03:24 PM


All times are GMT +1. The time now is 06:51 AM.

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"