Excel分类筛选,给出解决方案的追加50分!
发布网友
发布时间:2022-05-01 21:57
我来回答
共5个回答
热心网友
时间:2022-06-24 01:44
ALT+F11,粘入以下代码
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 And Target.Count = 1 And Target.Row > 1 Then
With Target.Validation
.Delete
.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, _
Formula1:="爬行,两栖"
End With
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Target.Row > 1 And Target.Count = 1 Then
With Target.Offset(0, 1).Validation
.Delete
Select Case Target
Case "爬行"
.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, _
Formula1:="鳄鱼,蛇"
Case "两栖"
.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, _
Formula1:="鳄鱼,鱼"
End Select
End With
End If
End Sub
热心网友
时间:2022-06-24 01:44
取巧办法:
A类你会吧,就是弄个有效性;
B类:
=CONCATENATE(IF(A1="爬行","鳄鱼","鳄鱼"),IF(A1="爬行","和蛇","和鱼"))
热心网友
时间:2022-06-24 01:45
先在E1输入“爬行”,E2输入“水栖”,选B1,数据-有效性-序列(序列=$E$1:$E$2)
A1公式=IF(B1="爬行","鳄鱼、蛇","鳄鱼、鱼")
热心网友
时间:2022-06-24 01:45
不妨去我的文档里下载二级下拉菜单文件看看。
热心网友
时间:2022-06-24 01:46
从菜单“数据-》筛选“中选择自动筛选,就可以实现。