excel类似筛选功能的问题
发布网友
发布时间:2024-10-03 09:18
我来回答
共4个回答
热心网友
时间:2024-10-03 09:48
高级筛选,在E1输入“性别”,E2输入“男”。选中数据区域A1:D4,数据-筛选-高级筛选,
列表区域:A1:D4
条件区域:E1:E2
选中“将筛选结果复制到其它位置”
复制到J1
确定
热心网友
时间:2024-10-03 09:51
数据-筛选-自动筛选
然后单击性别那里的小三角,选择“男”
复制到另一个地方即可
热心网友
时间:2024-10-03 09:48
试试我的
SHEET1 是 所有的信息
SHEET2与SHEET1格式相同
SHEET2 A2 输入公式
=IF(ISERR(INDEX(Sheet1!$A$1:$A$1000,SMALL(IF(Sheet1!$B$1:$B$1000="男",ROW($A$1:$A$1000),""),ROW(A1)),1)),"",INDEX(Sheet1!$A$1:$A$1000,SMALL(IF(Sheet1!$B$1:$B$1000="男",ROW($A$1:$A$1000),""),ROW(A1)),1))
CTRL ALT 回车结束
SHEET2 B2 输入公式
=IF(A2<>"","男","")
SHEET2 C2输入公式
=IF(ISERR(INDEX(Sheet1!$C$1:$C$1000,SMALL(IF(Sheet1!$B$1:$B$1000="男",ROW($A$1:$A$1000),""),ROW(A1)),1)),"",INDEX(Sheet1!$C$1:$C$1000,SMALL(IF(Sheet1!$B$1:$B$1000="男",ROW($A$1:$A$1000),""),ROW(A1)),1))CTRL ALT 回车结束
SHEET2 D2输入公式
=IF(ISERR(INDEX(Sheet1!$D$1:$D$1000,SMALL(IF(Sheet1!$B$1:$B$1000="男",ROW($A$1:$A$1000),""),ROW(A1)),1)),"",INDEX(Sheet1!$D$1:$D$1000,SMALL(IF(Sheet1!$B$1:$B$1000="男",ROW($A$1:$A$1000),""),ROW(A1)),1))
CTRL ALT 回车结束
然后将A2-D2向下填充
热心网友
时间:2024-10-03 09:48
请试一下如下VBA程序,相信会从中找到解决问题的一般方法,祝你成功!
Private Sub CommandButton1_Click()
Dim arr, brr
Dim ia As Integer, ib As Integer, j As Integer
arr = [A1:D4]
Range("F1:I4").ClearContents
brr = [F1:I4]
ib = 1
For ia = 1 To 4
If ia = 1 Or arr(ia, 2) = "男" Then
For j = 1 To 4
brr(ib, j) = arr(ia, j)
Next j
ib = ib + 1
End If
Next ia
[F1:I4] = brr
End Sub