Right now this thing puts a button over A1 and I would prefer it elsewhere. How do I change that?
Sub Contents_Hyperlinks()
'PURPOSE: Add hyperlinked buttons back to Table of Contents worksheet tab
Dim sht As Worksheet
Dim myShape As Shape
Dim ContentName As String
'Inputs - Table of Contents Worksheet Name
ContentName = "Contents"
'Loop Through Each Worksheet in Workbook
For Each sht In ActiveWorkbook.Worksheets
If sht.Name <> ContentName Then
'Create & Position Shape
Set myShape = sht.Shapes.AddShape(msoShapeRoundedRectangle, _
4, 4, 60, 20)
'Format Shape
myShape.Fill.ForeColor.RGB = RGB(91, 155, 213) 'Blue
myShape.Line.Visible = msoFalse
myShape.TextFrame2.TextRange.Font.Size = 10
myShape.TextFrame2.TextRange.Text = ContentName
myShape.TextFrame2.TextRange.Font.Bold = True
myShape.TextFrame2.TextRange.Font.Fill.ForeColor.RGB = RGB(255, 255, 255) 'White
'Assign Hyperlink to Shape
sht.Hyperlinks.Add myShape, "", _
SubAddress:="'" & ContentName & "'!A1"
End If
Next sht
End Sub
Bookmarks