Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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
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
Sub Worksheet_Change Matt Excel Discussion (Misc queries) 3 November 16th 07 04:40 PM
Worksheet_Change Jive Excel Worksheet Functions 2 June 11th 07 10:03 AM
Worksheet_change won't run Eric Excel Discussion (Misc queries) 4 March 10th 05 03:43 PM
worksheet_change vs. calculate, and worksheet_change not running Tom Ogilvy Excel Programming 1 July 14th 03 02:51 AM
worksheet_change vs. calculate, and worksheet_change not running Ross[_5_] Excel Programming 0 July 13th 03 04:27 PM


All times are GMT +1. The time now is 03:01 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"