Is there a way to name worksheets after Cells?

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hi ness222:

Welcome to the Board!

If I understand you correctly, Yes! -- you can put the filename in a cell, and then in the Workbook_BeforeSave event, have the procedure read the file name from the cell before saving it.

Regards!
Yogi Anand
 
Upvote 0
Sub SaveByCell()
Dim sFileName As String
'Cell A1 has the new file name.
sFileName = Sheets("Sheet1").Range("A1")

'If Cell A1 is Blank do not save.
If sFileName = "" Then Exit Sub

'The Drive:Path & the file name in cell A1.
ThisWorkbook.SaveAs "C:MyFilesExcelData" & sFileName
End Sub

Hope this helps?
Note: This is standard module code and you must code the drive and folder for this to work! JSW
 
Upvote 0
Sub myCellSheet()
' Standard module code.

' Add a sheet and name it the value of cell A1 from Sheet1.
Sheets.Add.Name = Sheets("Sheet1").Range("A1").Value

' Option, only rename the active sheet a new name,
' found in the cell A1 on Sheet1.
' Un-comment below and comment above to use!
'ActiveSheet.Name = Sheets("Sheet1").Range("A1").Value

' Option, This will re-name the current sheet to a name
' of your choice, by Input Box.
' Un-comment below and comment above to use!
'Dim MySheet
'ActiveSheet.Select
'MySheet = Application.InputBox(prompt:="Rename the current sheet to:", Type:=2)
'ActiveSheet.Name = MySheet
'Range("A1").Select

End Sub

Hope these options help. JSW
 
Upvote 0
nevermind i made it so it named the worksheet after a cell in itself and it updats automatically
 
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,434
Members
448,961
Latest member
nzskater

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