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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

 
Upvote 0

Forum statistics

Threads
1,215,417
Messages
6,124,777
Members
449,187
Latest member
hermansoa

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