EXCEL列表中,要求 1.点击A后展开B和C,没有点击会隐藏B和C 2.点击B或...
发布网友
发布时间:2024-08-19 18:14
我来回答
共2个回答
热心网友
时间:2024-08-22 12:56
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$D$1" Then
[a1].Select
Rows("2:3").Hidden = Not Rows("2:3").Hidden
ElseIf Target.Address = "$D$2" Then
Sheets("sheet2").Select
ElseIf Target.Address = "$D$3" Then
Sheets("sheet3").Select
End If
End Sub
热心网友
时间:2024-08-22 12:54
代码
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Row = 1 And Target.Column = 4 Then
Rows("1:4").Select
Selection.EntireRow.Hidden = False
Else
Rows("2:4").Select
Selection.EntireRow.Hidden = True
End If
End Sub
至于点击 D2 ,D3,你设置个超链接即可