Posts

Showing posts from December, 2022
Image
 How to Auto Lock Cell after Data entry in Excel VBA Code: Private Sub Worksheet_Change(ByVal Target As Range) Dim kk As Range      On Error Resume Next         Set kk = Intersect(Range("b3:c12"), Target)        If kk Is Nothing Then Exit Sub         Target.Worksheet.Unprotect Password:="222"       kk.Locked = True         Target.Worksheet.Protect Password:="222" End Sub
Image
  How To Prevent / Restriction Duplicate Entry in Excel VBA Code; Private Sub Worksheet_Change(ByVal Target As Range)     With Target         If (.Column <> 2 And .Column <> 5) Or .Cells.Count > 1 Then Exit Sub         If WorksheetFunction.CountIfs(Columns(.Column), .Value) > 1 Then             Application.DisplayAlerts = False             .ClearContents             Application.DisplayAlerts = True             MsgBox "Duplicate value!"         End If     End With End Sub
Image
 Excel VBA: Good Mark with Double Click Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) If Target.Column = 4 Then Cancel = True Target.Font.Name = "Wingdings"     If Target.Value = "" Then         Target.Value = "ΓΌ"         Else         Target.Value = ""         End If         End If End Sub                                                       YouTube Video