Create Generic Hyperlink to Move to "First", "Previous", "Next" and "Last" Sheet within the same Workbook using Left & Right Autoshapes.
Dear Board,
I have created Four Autoshapes using Left and Right Autoshapes and I need to use these Autoshapes to go to different Sheets..
Left Autoshape I - "First" - Needs to take me to the very First Sheet in the Workbook.
Left Autoshape II - "Previous" - Needs to take me to the Previous Sheet before the ActiveSheet in the Workbook.
Right Autoshape I - "Next" - Needs to take me to the Next Sheet in the Workbook.
Left Autoshape II - "Previous" - Needs to take me to the Last Sheet in the Workbook.
I have used the following link to create these Autoshapes..http://www.mrexcel.com/forum/excel-questions/305014-rename-autoshape-adding-text.html
Can someone also guide me hot o have these 4 Autoshapes one below the other in a loop with a small gap of just 2 in between any two Autoshapes as well as the Hyperlinks..
Warm Regards
all4excel
Dear Board,
I have created Four Autoshapes using Left and Right Autoshapes and I need to use these Autoshapes to go to different Sheets..
Left Autoshape I - "First" - Needs to take me to the very First Sheet in the Workbook.
Left Autoshape II - "Previous" - Needs to take me to the Previous Sheet before the ActiveSheet in the Workbook.
Right Autoshape I - "Next" - Needs to take me to the Next Sheet in the Workbook.
Left Autoshape II - "Previous" - Needs to take me to the Last Sheet in the Workbook.
I have used the following link to create these Autoshapes..http://www.mrexcel.com/forum/excel-questions/305014-rename-autoshape-adding-text.html
Code:
Sub AddShapes()
Dim ShapeObj As Object
Dim ShpName As String
Dim MacroName As String
MacroName = "First"
'-------------------------------------------------------------------------
ActiveSheet.Range("A1").Activate ' only works if the sheet is the Active one
ShpName = "First"
'-------------------------------------------------------------------------
'(Across Page, Down Page, length, width)
Set ShapeObj = _
ActiveSheet.Shapes.AddShape(msoShapeLeftArrow, Range("E1").Left + 2, Range("E1").Top + 2, Range("E1").Width - 4, 38)
'--------------------------------------------------------------------------
With ShapeObj
'----------------------------------------------------------------------
.Fill.ForeColor.RGB = RGB(0, 0, 255)
.Fill.BackColor.RGB = RGB(0, 0, 97)
.Fill.TwoColorGradient msoGradientHorizontal, 1
'---------------------------------------------------------------------
'- NAME THE RECTANGLE
.Name = ShpName
'---------------------------------------------------------------------
'- RUN A MACRO
' .OnAction = MacroName
'---------------------------------------------------------------------
With .TextFrame
.Characters.Text = ShpName
.Characters.Font.Size = 14
.Characters.Font.Name = "Times New Roman"
.Characters.Font.Bold = True
.Characters.Font.ColorIndex = 2
.HorizontalAlignment = xlHAlignCenter
.VerticalAlignment = xlVAlignCenter
End With
'--------------------------------------------------------------------
End With
End Sub
Warm Regards
all4excel