A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Combine 2 worksheet change events



 
 
Thread Tools Display Modes
  #1  
Old May 28th, 2010, 10:49 AM posted to microsoft.public.excel.misc
nobbyknownowt[_10_]
external usenet poster
 
Posts: 1
Default Combine 2 worksheet change events


I have a worksheet that I want to place 2 worksheet change events on. i
know that I cannot do this and that I have to combine them into one. I
just cannot get my head around how I do that. Is there an idiots guide
anywhere (idiot being the operative term here ;-)

firstly I have this to make text in certain cells upper case

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then
Exit Sub
End If
On Error GoTo ErrHandler:
If Not Application.Intersect(Me.Range("E5:L5"), Target) Is Nothing
Then
If IsNumeric(Target.Value) = False Then
Application.EnableEvents = False

Target.Value = StrConv(Target.Text, vbUpperCase)

Application.EnableEvents = True
End If
End If
ErrHandler:
Application.EnableEvents = True

then I have


Private Sub Worksheet_Change(ByVal Target As Range)

Dim icolor As Integer


If Not Intersect(Target, Range("G24:I24")) Is Nothing Then

Select Case Target

Case -1000 To 29

icolor = 3

Case 30 To 34

icolor = 45

Case 35 To 45

icolor = 4

Case 46 To 50

icolor = 45

Case 51 To 1000

icolor = 3

Case Else

'Whatever

End Select



Target.Interior.ColorIndex = icolor

End If


To give me extra conditional formatting for users of old excel
versions.


Any input gratefully received

cheers
nobby




--
nobbyknownowt
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:40 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.