View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Norman Jones
 
Posts: n/a
Default How to run Multiple Macro's in Worksheet?

Hi Ben,

When I use the following macro's one at a time in the worksheet they work
great. What do I need to do to be able to run both of them in the same
worksheet at the same time?


It is only possible to have one Worksheet_Change procedure in a given sheet
module. Therefore, you need to combine your two procedures.

Try replacing the existing code with:

'=============
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim R As Long
R = Target.Row

If Target.Column < 2 Then Exit Sub
If Target.Row = 1 Then Exit Sub

On Error GoTo ErrHandler
Application.EnableEvents = False
Target.Offset(0, 2).Value = Date

If Not Intersect(Range("l2:l15"), Target) Is Nothing Then
Range("l2:m15").Sort Key1:=Range("l2")
End If

ErrHandler:
Application.EnableEvents = True
End Sub
'<<=============


---
Regards,
Norman