LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Visual Basic programming in Excel for conditional formatting

Hi all,

I am trying to create a spreadsheet that will highlight certain
conditions when they match. So far I have what is below. I need to add
another case that will highlight the row when a date passes (ie,
todays()). I would like it to highlight interior red with white bold
font. And how do i get this code to act on multiple rows?

Any help appreciated :)

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


On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("B3:X3")) Is Nothing Then
With Target
Select Case .Value
Case "condition 1": Range("B3:X3").Interior.ColorIndex
= 15
Case "condition 2": Range("B3:X3").Interior.ColorIndex
= 35
Case "", "condition3":
Range("B3:X3").Interior.ColorIndex = 0
Case "condition 4": Range("B3:X3").Interior.ColorIndex
= 0
Case "condition 5": Range("B3:X3").Interior.ColorIndex
= 0


End Select
End With
End If


ws_exit:
Application.EnableEvents = True
End Sub

 
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
Visual Basic Programming for Excel Venkatesh New Users to Excel 4 August 6th 07 11:48 AM
Visual Basic programming Jannick Excel Discussion (Misc queries) 2 February 27th 06 02:23 PM
Help with Visual Basic programming phoenixx153 Excel Programming 2 February 27th 06 01:52 AM
visual basic conditional formatting produces strange results Carl[_3_] Excel Programming 3 January 25th 06 02:01 PM
visual basic conditional formatting produces strange results Carl[_3_] Excel Programming 0 January 25th 06 08:30 AM


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