Jagat Pavasia
Active Member
- Joined
- Mar 9, 2015
- Messages
- 406
- Office Version
- 2021
- Platform
- Windows
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.CountLarge > 1 Then Exit Sub
Application.EnableEvents = False
Me.Unprotect
If Not Intersect(Target, [B:B,L:L]) Is Nothing Then
If Target.Value = "**" Then
Target.Value = Date
Target.NumberFormat = "DD/MM/YYYY"
End If
ElseIf Not Intersect(Target, [E1]) Is Nothing Then
If Target.Value = "" Then
Me.Range("A3:U3").AutoFilter Field:=Target.Column
Else
Me.Range("A3:U3").AutoFilter Field:=Target.Column, _
Operator:=xlFilterValues, _
Criteria1:="*" & CStr(Target.Value) & "*"
End If
ElseIf Not Intersect(Target, [A1:V1]) Is Nothing Then
If Target.Value = "" Then
Me.Range("A3:U3").AutoFilter Field:=Target.Column
Else
Me.Range("A3:U3").AutoFilter Field:=Target.Column, _
Operator:=xlFilterValues, _
Criteria1:=CStr(Target.Value)
End If
ElseIf Not Intersect([G:G], Target) Is Nothing Then
If Target = "**" Then Target = WorksheetFunction.Max([G:G]) + 1
End If
Me.Protect DrawingObjects:=False, Contents:=True, _
Scenarios:=False, AllowFormattingCells:=True, _
AllowFiltering:=True
Application.EnableEvents = True
End Sub
I have this VBA code in My sheet , but when I input date in L3 than it is not working,
I have tried by change Formatting by Text, Date, Custom etc. but not working.
I am new in VBA code, so please edit my VBA and than give me