linking excel sheet names

  • Thread starter Thread starter bkey01
  • Start date Start date
B

bkey01

I have created a workbook that has 24 sheets and each sheet has
different name. I need to replicate this workbook 32 times for 3
different product names. Can I link the sheet name so I do not have t
retype it EVERYTIME!

Help Please!



Report this post to a moderator | IP: Logge
 
I have created a workbook that has 24 sheets and each sheet has a
different name. I need to replicate this workbook 32 times for 32
different product names. Can I link the sheet name so I do not have to
retype it EVERYTIME!

Presumably you mean link the worksheet name to some cell in the worksheet. You
could only do this with macros and VBA, but that'd likely involve more time an
effort than selecting the cell with the product name, pressing [Ctrl]+C, then
running the menu command Format > Sheet > Rename, and pressing [Ctrl]+V then
[Enter]. But if you must have a macro for this, and if the product ID were
always in cell B3, then try

Sub foo()
Dim ws As Worksheet
On Error Resume Next
For Each ws In Worksheets
ws.Name = ws.Range("B3").Value
If Err.Number <> 0 Then
ws.Name = "ERROR renaming sheet " & Format(ws.Index)
Err.Clear
End If
Next ws
End Sub
 
Back
Top