Change Sheet Name when copying cell

BeerBeer101

New Member
Joined
Dec 29, 2021
Messages
35
Office Version
  1. 365
Platform
  1. Windows
Hi again,
copying from cell to cell (down) and changing the filename:
1656621012074.png


B3 - links to a sheet called #1.xlsx
B4 - links to a sheet called #2.xlsx
and on down the line it goes. is there a copy function that will ad 1 number to the sheet name (i have about 1200 sheets total) as opposed to having to manually change the 1, 2, 3, 4 etc etc...
appreciate the help!
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
You could try doing this with a macro something like this:
VBA Code:
Sub fill()
For I = 3 To 1200
ActiveSheet.Range("B" & I).Formula = "='b:\completed\[#" & I - 2 & ".xlsx]Input Sheet'!$D$1"
Next I
End Sub
 
Upvote 0
If the number of sheets were to change in the future this might be an ideal setup as well:

VBA Code:
Option Explicit

Sub BeerBeer101()

    Dim Numsheet As String
    Dim i As Integer
    
    'B:\Completed\
    Application.DisplayAlerts = False
    Numsheet = InputBox("How many sheets do you need to reference?")
        If Numsheet = "" Then
                Application.DisplayAlerts = True
                Exit Sub
            Else
            For i = 3 To Numsheet + 2
                ActiveSheet.Range("B" & i).Formula = "='B:\Completed\[#" & i - 2 & ".xlsx]Input Sheet'!$D$1"
            Next i
        End If
    Application.DisplayAlerts = False
    
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,216,126
Messages
6,129,004
Members
449,480
Latest member
yesitisasport

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