I have these two commands that appeared to work previously . Any help will be appreciated Thank you
Private Sub CommandButton1_Click()
Range("A2:j6000").ClearContents
End Sub
Private Sub CommandButton1_Click()
Range("e2:e6000").ClearContents
End Sub
Other commands on the sheet are as follows
Private Sub CommandButton3_Click()
Dim sh As Worksheet, lr As Long, rng As Range
Set sh = ActiveSheet
lr = sh.Cells(Rows.Count, 2).End(xlUp).Row
sh.Unprotect "jmc"
sh.Rows.Hidden = False
sh.Range("D1:D" & lr).AutoFilter 1, "C", , , False
Set rng = sh.Range("D2:D" & lr).SpecialCells(xlCellTypeVisible).EntireRow
sh.Range("D1:D" & lr).AutoFilter
rng.Hidden = True
ActiveSheet.Protect "jmc"
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("a2:k6000")) Is Nothing Then Exit Sub
Application.EnableEvents = False
Me.sort.SortFields.Clear
Me.sort.SortFields.Add Key:=Range("b2:b6000"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With Me.sort
.SetRange Range("A2:k6000")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Application.EnableEvents = True
End Sub
Private Sub CommandButton1_Click()
Range("A2:j6000").ClearContents
End Sub
Private Sub CommandButton1_Click()
Range("e2:e6000").ClearContents
End Sub
Other commands on the sheet are as follows
Private Sub CommandButton3_Click()
Dim sh As Worksheet, lr As Long, rng As Range
Set sh = ActiveSheet
lr = sh.Cells(Rows.Count, 2).End(xlUp).Row
sh.Unprotect "jmc"
sh.Rows.Hidden = False
sh.Range("D1:D" & lr).AutoFilter 1, "C", , , False
Set rng = sh.Range("D2:D" & lr).SpecialCells(xlCellTypeVisible).EntireRow
sh.Range("D1:D" & lr).AutoFilter
rng.Hidden = True
ActiveSheet.Protect "jmc"
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("a2:k6000")) Is Nothing Then Exit Sub
Application.EnableEvents = False
Me.sort.SortFields.Clear
Me.sort.SortFields.Add Key:=Range("b2:b6000"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With Me.sort
.SetRange Range("A2:k6000")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Application.EnableEvents = True
End Sub