Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
worksheet_change
Hi
I have attached the excel with code. Based on the drop down list change in column G and H, the values i C,D,E & F will change from 1 through 5. Based on the numberic value in C,D,E & F, the color in it should chang You should be able to set different colors for values = 1,2,3,4,5. NOTE: Currenlty only cells in C are changing if the number in i changes to 1,2, or 3. Other cells in D,E and F columns do not chang despite the change in their values. Let me know the solution !!!! =================== Private Sub Worksheet_Change(ByVal Target As Range) Dim icolor As Integer If Not Intersect(Target, Range("C:F")) Is Nothing Then Select Case Target Case 0 icolor = 2 Case 1 icolor = 56 Case 2 icolor = 22 Case 3 icolor = 27 Case 4 icolor = 4 Case 5 icolor = 10 Case Else icolor = 2 End Select Target.Interior.ColorIndex = icolor End If End Sub ================= Attachment filename: colortest v9.xls Download attachment: http://www.excelforum.com/attachment.php?postid=66020 -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
worksheet_change
See previous post.
-- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "aravindvin " wrote in message ... Hi I have attached the excel with code. Based on the drop down list change in column G and H, the values in C,D,E & F will change from 1 through 5. Based on the numberic value in C,D,E & F, the color in it should change You should be able to set different colors for values = 1,2,3,4,5. NOTE: Currenlty only cells in C are changing if the number in it changes to 1,2, or 3. Other cells in D,E and F columns do not change despite the change in their values. Let me know the solution !!!! =================== Private Sub Worksheet_Change(ByVal Target As Range) Dim icolor As Integer If Not Intersect(Target, Range("C:F")) Is Nothing Then Select Case Target Case 0 icolor = 2 Case 1 icolor = 56 Case 2 icolor = 22 Case 3 icolor = 27 Case 4 icolor = 4 Case 5 icolor = 10 Case Else icolor = 2 End Select Target.Interior.ColorIndex = icolor End If End Sub ================== Attachment filename: colortest v9.xls Download attachment: http://www.excelforum.com/attachment.php?postid=660204 --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sub Worksheet_Change | Excel Discussion (Misc queries) | |||
Worksheet_Change | Excel Worksheet Functions | |||
Worksheet_change won't run | Excel Discussion (Misc queries) | |||
worksheet_change vs. calculate, and worksheet_change not running | Excel Programming | |||
worksheet_change vs. calculate, and worksheet_change not running | Excel Programming |