links in cells

BrendanDixon

Board Regular
Joined
Mar 7, 2010
Messages
174
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi all,

I have a workbook with 400 sheets named "1", "2", "3" etc to "400"
In cell C1 of each sheet I want it to show the values of cells B3 to B403 in a sheet called index.

I have written this code but cannot seem to get it right to work.

Code:
Sub test3()
Dim I As Long
  
 
    For I = 2 To 400
 
        Sheets(I).Select
        Range("C1").Select
        ActiveCell.FormulaR1C1 = ("=Index!B" & (I) + 2)

    Next I
End Sub
Can anyone tell me what is wrong with this code and how can I fix it.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Drop the R1C1
Also no need to select the sheet..

Try

Code:
For i = 2 To 400
    Sheets(i).Range("C1").Formula = "=Index!B" & i + 1
Next i

Presuming you meant that

Sheet2 C1 = Index B3
Sheet3 C1 = Index B4
Sheet4 C1 = Index B5
etc..
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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