|
使用工作表事件完成。
- Private Sub Worksheet_Change(ByVal Target As Range)
- If Target.Count > 1 Then Exit Sub
- If Target.Column <> 3 Then Exit Sub
- If Target.Row = 1 Then Exit Sub
- Sheets(Target.Value).Select
- Target.Hyperlinks.Add Anchor:=Target, Address:="", SubAddress:=Target.Value & "!A1", TextToDisplay:=Target.Value
- End Sub
- Private Sub Worksheet_SelectionChange(ByVal Target As Range)
- If Target.Count > 1 Then Exit Sub
- If Target.Column <> 3 Then Exit Sub
- If Target.Row = 1 Then Exit Sub
- Dim sh&, s$
- For sh = 3 To Sheets.Count
- s = s & "," & Sheets(sh).Name
- Next
- Cells.Validation.Delete
- Target.Validation.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:=Mid(s, 2)
- End Sub
复制代码 |
评分
-
查看全部评分
|