LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default Auto color-shading of rows

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Select Case .Value
Case 436: .EntireRow.Interior.ColorIndex = 6
Case 437: .EntireRow.Interior.ColorIndex = 5
'etc
End Select
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--

HTH

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


"Fitz" wrote in message
.. .
Can I automate an excel worksheet such that if ,say, "436" is written in a
certain cell it shades that row yellow, or if "437" is in that cell it
shades the row blue. It would then be easy to visually tell in an excel
chart which lines belonged to ,say, specific companies.




 
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
How to have formulas and formats auto copy to new inserted rows DippyDawg Excel Discussion (Misc queries) 2 August 5th 05 03:09 PM
auto deleting defined rows LoriM Excel Discussion (Misc queries) 4 August 4th 05 06:20 PM
Column Auto Width and Hidden Rows KWCounter Excel Discussion (Misc queries) 1 May 20th 05 12:59 AM
Auto adjusting # rows between 2 worksheets kevin mckellar New Users to Excel 1 December 30th 04 03:01 PM
AUTO HIDE ROWS Alan Excel Worksheet Functions 1 November 27th 04 09:13 AM


All times are GMT +1. The time now is 08:05 PM.

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"