Hello
I am using the following code below to autofilter the whole sheet, and have the column C with value of 1 for which rows I want to autofilter from VB. The problem is I have a couple cells that I have been told have to be protected. When I protect the sheet with only those cells locked, and then run this code, I get an error 400.
The true filtered range should be C9:C70.
Any suggestions on what to do?
I am using the following code below to autofilter the whole sheet, and have the column C with value of 1 for which rows I want to autofilter from VB. The problem is I have a couple cells that I have been told have to be protected. When I protect the sheet with only those cells locked, and then run this code, I get an error 400.
The true filtered range should be C9:C70.
Any suggestions on what to do?
Code:
Sub BOMprints()
Columns("C:C").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="1"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Preview:=True, Collate:=True
Selection.AutoFilter Field:=1
Selection.AutoFilter
End Sub