What am I doing wrong?

SteveT24

New Member
Joined
Apr 19, 2018
Messages
7
I have a worksheet with 100 tabs, each tab is meant to break down bids for a specific trade. I have a summary sheet that displays top 2 bidders for each tab. I want to change the hyperlinks on the summary sheet to go to cell A1 for each tab. Why isn't this working?

When I execute, it changes the hyperlink to show Tab '99' for every row, but it should be starting at 1 and ending at 100.

Sub LinkSummaryToScope()

'Establish Loop Variable
Dim sheet As Integer
sheet = 1

Dim li As String
li = "'"

Dim nk As String
nk = "'!A1"

Dim link As String

'Select first cell with link
Range("B8").Select

'Begin Loop
For sheet = 1 To 100

'Select Hyperlink Cell
link = li + CStr(sheet) + nk
Selection.Hyperlinks(1).SubAddress = link
With Selection.Font
.Name = "Calibri"
.Size = 10
.Strikethrough = False
.Superscript = False
' .Subscript = False
.OutlineFont = False
.Shadow = False
.TintAndShade = 0
.ThemeFont = xlThemeFontMinor
End With

ActiveCell.Offset(1, 0).Select
Next sheet

End Sub
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

 
Upvote 0

Forum statistics

Threads
1,214,826
Messages
6,121,793
Members
449,048
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top