在我的工具中,我正在尝试创建一个形状,重命名它,让它随着列的移动宽度移动,并将其超链接到摘要表。到目前为止,这是我所拥有的,在此先感谢。
For s = 7 To Sheets.Count
With Sheets(s)
Dim GoToSummary As Shape
Set GoToSummary = .Shapes.AddShape(msoShapeRoundedRectangle, 400, 153 + 12.75 * 2, 300, 50)
.Shapes(GoToSummary).TextFrame.Characters.Text = "Go Back To Summary"
End With
Next s
我知道这不正确,这就是我伸出援手的原因,因为我无法找到与我的情况类似的东西。
答案 0 :(得分:2)
你非常接近!
Sub test()
Dim GoToSummary As Shape
For s = 7 To Sheets.Count
Set GoToSummary = Sheets(s).Shapes.AddShape(msoShapeRoundedRectangle, 400, 153 + 12.75 * 2, 300, 50)
GoToSummary.TextFrame.Characters.Text = "Go Back To Summary"
Sheets(s).Hyperlinks.Add Anchor:=GoToSummary, Address:="", SubAddress:="Summary!A1"
Next s
End Sub
Dim GoToSummary
在循环之外GoToSummary
而不是.Shapes(GoToSummary)