Skip to content

Instantly share code, notes, and snippets.

@zhimiaoli
Last active December 29, 2015 09:49
Show Gist options
  • Save zhimiaoli/7653142 to your computer and use it in GitHub Desktop.
Save zhimiaoli/7653142 to your computer and use it in GitHub Desktop.
将选中的表格,链接到标题为表格内容中的表。
Sub createhyperlink()
'
' 将选中的表格,链接到标题为表格内容中的表。
' 举个列子,如果单元格的内容是foo,就会把这个表格链接到foo表。
'
'
On Error Resume Next
For Each celln In Selection
celln.Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
celln.Value & "!A1", TextToDisplay:=celln.Value
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment