Multiple Worksheet_Change commands on same worksheet?

sethmeister21

New Member
Joined
Mar 10, 2010
Messages
20
Hello all - I'm dealing with a Worksheet_Change command in Excel 2003....Q: I don't think it's possible to have Multiple Worksheet_Change commands on same worksheet? >>>>Well....I get an error message so Im guessing not...

How can i combine the following commands?

'this highlights rows that contains trigger words
Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Text
Case "Hotmail"
Target.EntireRow.Interior.ColorIndex = 37
Case "Google"
Target.EntireRow.Interior.ColorIndex = 37
Case "Yahoo"
Target.EntireRow.Interior.ColorIndex = 37
Case "Bing"
Target.EntireRow.Interior.ColorIndex = 37
Case "AltaVista"
Target.EntireRow.Interior.ColorIndex = 37
End Select
Call Highlight_Event_Type
End Sub


Private Sub Worksheet_Change(ByVal Target As Range) 'Does the validation range still have validation? If HasValidation(Range("ValidationRange")) Then Exit Sub Else Application.Undo MsgBox "Your last operation was canceled." & _ "It would have deleted data validation rules.", vbCritical End IfEnd SubPrivate Function HasValidation(r) As Boolean' Returns True if every cell in Range r uses Data Validation On Error Resume Next x = r.Validation.Type If Err.Number = 0 Then HasValidation = True Else HasValidation = FalseEnd Function</PRE>


As ever, all help greatly appreciated!!
regards
S
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,215,472
Messages
6,125,003
Members
449,203
Latest member
Daymo66

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top