It is strange. I ran that and it showed the range was there. Then I commented out the function call and added some code around what you supplied so that my code now looks like this;
and now it works!Code:Private Sub cmdRemoveItem_Click() Const FilterString As String = "No" Dim lngLastRow As Long Dim rngToCheck As Range Dim xval As Variant Dim lcol As Long Dim xlCalc As XlCalculation Call FreezeScreen worksheets("sheet1").Unprotect 'If NamedRangeExists("PickList") Then With Sheet1.Range("PickList") .AutoFilter Field:=2, Criteria1:=FilterString On Error Resume Next .SpecialCells(xlCellTypeVisible).EntireRow.Delete On Error GoTo 0 End With 'End If worksheets("sheet1").Protect Call UnFreezeScreen End Sub
One final question if I may : How do I get the filter to come back with all available records shown after the delete?




Reply With Quote