发布网友 发布时间: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,你设置个超链接即可