i would like to combine between the following two code
andHTML Code:
HTML Code:
i would like to combine between the following two code
andHTML Code:
HTML Code:
![]()
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Row = 1 Then Exit Sub On Error GoTo ErrHandler Application.EnableEvents = False If Target.Column = 1 Then Call Add_name(Target) End If ErrHandler: Application.EnableEvents = True Err.Clear On Error GoTo ReEnable If Target.Cells.Count = 1 Then If Not Intersect(Target, Range("I:AF")) Is Nothing Then 'Test if Target is in columns I:AF If Target.Row Mod 5 = 2 Then 'Test if Target is in rows 2,7,12,17... Application.EnableEvents = False 'Allow entries based on column E value If Not Intersect(Target, Range("I:AF").Resize(, Range("E" & Target.Row).Value)) Is Nothing Then 'Date stamp If Target.Value > 0 Then Target.Offset(4, 0).Value = Date Else 'Clear entry MsgBox "Not Allowed", vbExclamation, "Invalid Entry" Target.Value = "" End If Application.EnableEvents = True End If End If End If ReEnable: Application.EnableEvents = True If Err.Number <> 0 Then MsgBox Err.Description, vbCritical, "Error " & Err.Number End Sub
Frob first, tweak later
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks