Hi Guys
I desperatley require help with the following, i have a work book that i use as a database for work requests that is kept on a server which other people can log job requests on, basically the vba code that i have created seems to slow the work book right down which is making it practically impossible to log jobs?
Here is the macro EventProc1 creates a time stamp, EventProc2 sorts column J
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
Application.EnableEvents = False
EventProc1 Target
EventProc2 Target
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Private Sub EventProc1(ByVal Target As Range)
If Target.Column = 10 Then
Application.EnableEvents = False
Cells(Target.Row, 11).Value = Date + Time
Application.EnableEvents = True
End If
End Sub
Private Sub EventProc2(ByVal Target As Range)
Dim LR As Long
If Target.Column <> 10 Then Exit Sub
LR = Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row
Range("A1:N" & LR).Sort Key1:=Range("J2"), Order1:=xlDescending, _
Header:=xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub
Any help with this would be greatly appricated?
I desperatley require help with the following, i have a work book that i use as a database for work requests that is kept on a server which other people can log job requests on, basically the vba code that i have created seems to slow the work book right down which is making it practically impossible to log jobs?
Here is the macro EventProc1 creates a time stamp, EventProc2 sorts column J
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
Application.EnableEvents = False
EventProc1 Target
EventProc2 Target
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Private Sub EventProc1(ByVal Target As Range)
If Target.Column = 10 Then
Application.EnableEvents = False
Cells(Target.Row, 11).Value = Date + Time
Application.EnableEvents = True
End If
End Sub
Private Sub EventProc2(ByVal Target As Range)
Dim LR As Long
If Target.Column <> 10 Then Exit Sub
LR = Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row
Range("A1:N" & LR).Sort Key1:=Range("J2"), Order1:=xlDescending, _
Header:=xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub
Any help with this would be greatly appricated?