ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   naming tabs automated (https://www.excelbanter.com/excel-discussion-misc-queries/172271-naming-tabs-automated.html)

officegirl

naming tabs automated
 
I need to name numerous tabs in a worksheet from one cell within that
worksheet, I have been retyping it , is there a way to copy it to the tab ?

Gary''s Student

naming tabs automated
 
This small macro assumes that the desired names are in cell A1 of each sheet:

Sub name_um()
For Each ws In Worksheets
ws.Name = ws.Range("A1").Value
Next
End Sub

--
Gary''s Student - gsnu200764


"officegirl" wrote:

I need to name numerous tabs in a worksheet from one cell within that
worksheet, I have been retyping it , is there a way to copy it to the tab ?


dlw

naming tabs automated
 
copy the name, in re-name mode on the tab, do a <Ctrl<v

"officegirl" wrote:

I need to name numerous tabs in a worksheet from one cell within that
worksheet, I have been retyping it , is there a way to copy it to the tab ?


Bernard Liengme

naming tabs automated
 
You will need to use VBA. Here is a subroutine that works:

Sub NameSheets()
For Each ws In Worksheets
ws.Name = ws.Range("A1").Value
Next
End Sub

New to VBA? See David McRitchie's site on "getting started" with VBA
http://www.mvps.org/dmcritchie/excel/getstarted.htm

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"officegirl" wrote in message
...
I need to name numerous tabs in a worksheet from one cell within that
worksheet, I have been retyping it , is there a way to copy it to the tab
?




JE McGimpsey

naming tabs automated
 
One way:

Put this in the ThisWorkbook code module of your workbook:


Private Sub Workbook_SheetChange( _
ByVal Sh As Object, _
ByVal Target As Excel.Range)
Dim sSheetName As String
With Target
If Not Intersect(.Cells, Range("A1")) Is Nothing Then
sSheetName = Range("A1").Text
If Not sSheetName = vbNullString Then
On Error Resume Next
Sh.Name = sSheetName
On Error GoTo 0
If Not sSheetName = Sh.Name Then _
MsgBox "Invalid worksheet name in cell A1"
End If
End If
End With
End Sub



In article ,
officegirl wrote:

I need to name numerous tabs in a worksheet from one cell within that
worksheet, I have been retyping it , is there a way to copy it to the tab ?


officegirl

naming tabs automated
 
Thanks

"Bernard Liengme" wrote:

You will need to use VBA. Here is a subroutine that works:

Sub NameSheets()
For Each ws In Worksheets
ws.Name = ws.Range("A1").Value
Next
End Sub

New to VBA? See David McRitchie's site on "getting started" with VBA
http://www.mvps.org/dmcritchie/excel/getstarted.htm

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"officegirl" wrote in message
...
I need to name numerous tabs in a worksheet from one cell within that
worksheet, I have been retyping it , is there a way to copy it to the tab
?





officegirl

naming tabs automated
 
thanks so much

"dlw" wrote:

copy the name, in re-name mode on the tab, do a <Ctrl<v

"officegirl" wrote:

I need to name numerous tabs in a worksheet from one cell within that
worksheet, I have been retyping it , is there a way to copy it to the tab ?



All times are GMT +1. The time now is 01:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com