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: 1
Default combine worksheet events


Hi,
I have already 2 worksheet events in one sheet and i wanted to ad
one more the present code are like this:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Cells(Target.Row, 1) _
.Range("J1,K1,L1,P1,Q1,R1,U1,V1,W1"), Target) Is Nothing Then
If Cells(Target.Row, "I") = "" Then
MsgBox "SORRY THE I COLUMN IS EMPTY FILL IT with P or S"
Application.EnableEvents = False
Target.Value = ""
Application.EnableEvents = True
End If
End If

If Intersect(Target, Range("C2:C2")) Is Nothing Then Exit Sub
If Range("C2:C2") 0 Then CUSTOMER
End Sub

now i wanted to add the following code to the above :


Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Range("D2,G2")) Is Nothing Then
With Target
.Value = Application.Proper(.Value)
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

Any suggestions will be highly appreciated
with best regards
nowa

--
nowfa
-----------------------------------------------------------------------
nowfal's Profile: http://www.excelforum.com/member.php...fo&userid=1000
View this thread: http://www.excelforum.com/showthread.php?threadid=39033

 
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
Combine 2 worksheet change events nobbyknownowt Excel Discussion (Misc queries) 0 May 28th 10 10:49 AM
Worksheet Events DCSwearingen Excel Discussion (Misc queries) 2 May 24th 06 10:42 PM
Workbook and Worksheet Events Chaplain Doug Excel Programming 6 January 13th 05 11:55 PM
Worksheet events agarwaldvk[_33_] Excel Programming 0 October 4th 04 10:41 PM
Worksheet events agarwaldvk[_32_] Excel Programming 1 October 4th 04 09:08 AM


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