Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Coloring cells using VBA in excel

Bob

iColor = 99 throws an error in 2003

Change to anything <57 and OK


Gord

On Sun, 25 Apr 2010 17:39:40 +0100, "Bob Phillips"
wrote:

TRy

Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Long
Dim cell As Range
If Not Intersect(Target, Range("B4:J33")) Is Nothing Then
For Each cell In Target
Select Case cell
Case "Dan"
icolor = 34
Case "John"
icolor = 35
Case "Rose"
icolor = 38
Case Else
icolor = 99
End Select
cell.Interior.ColorIndex = icolor
Next cell
End If
End Sub


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
Excel Macro for Coloring the cells Dhawal Excel Discussion (Misc queries) 1 October 5th 06 12:32 AM
Conditional coloring of Excel cells, based on adjacent cell values? Greg Stuart Excel Worksheet Functions 0 March 10th 06 10:14 PM
Problem while coloring cells in excel through vb Jo Excel Discussion (Misc queries) 0 February 14th 06 09:50 AM
No shading or coloring of cells in excel. Is it windowXP setting? Marker123 Excel Discussion (Misc queries) 1 January 23rd 06 05:21 AM
COLORING IN CELLS jim mcgrath Excel Discussion (Misc queries) 4 November 24th 05 04:31 PM


All times are GMT +1. The time now is 05:47 AM.

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

About Us

"It's about Microsoft Excel"