更新时间:2023-02-02 21:02:01
关注应该为您执行此操作的VBA代码。请注意您需要修改的评论。
Following VBA code that should do this for you. Note the comments where you will need to edit.
Sub Macro1()
Dim rngFiltered As Range
使用工作表("Sheet1") '编辑" Sheet1"到您的工作表名称
.UsedRange.Rows(1).AutoFilter
      &的 '继行编辑字段:= 6至与所述一个的 强列号>
.AutoFilter.Range.AutoFilter字段:= 6,标准1:=" 1 QUOT;
       
使用.AutoFilter.Range
设置rngFiltered = .Offset(1,0)_
               &NBSP ;                .Resize(.Rows.Count - 1,.Columns.Count)_
                                 .SpecialCells(xlCellTypeVisible)
结束与$
rngFiltered.EntireRow.Delete shift:= xlUp
.AutoFilterMode = False
Application.Goto .Range(" A1"),scroll:= True
'可选
结束于$
结束子
Sub Macro1()
Dim rngFiltered As Range
With Worksheets("Sheet1") 'Edit "Sheet1" to your sheet name
.UsedRange.Rows(1).AutoFilter
'Following line edit Field:=6 to the column number with the one's
.AutoFilter.Range.AutoFilter Field:=6, Criteria1:="1"
With .AutoFilter.Range
Set rngFiltered = .Offset(1, 0) _
.Resize(.Rows.Count - 1, .Columns.Count) _
.SpecialCells(xlCellTypeVisible)
End With
rngFiltered.EntireRow.Delete shift:=xlUp
.AutoFilterMode = False
Application.Goto .Range("A1"), scroll:=True
'Optional
End With
End Sub