ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Naming The Tabsheet from a cell (https://www.excelbanter.com/excel-discussion-misc-queries/77160-naming-tabsheet-cell.html)

JackR

Naming The Tabsheet from a cell
 
I have this routine that I am runing, but the problem is it changes all the
tabs on every sheet, how can I have only change the tab for the sheet I am
working on?

Here is what I am using

Sub nametab()
Dim i As Integer
On Error Resume Next
For i = 1 To Sheets.Count
Sheets(i).Name = Sheets(i).Range("G1").Value
Next i
On Error GoTo 0

Any help would be great.

Ardus Petus

Naming The Tabsheet from a cell
 
sub rename()
ActiveSheet.Name = Range("G1").Value
end sub

HTH
--
AP

"JackR" a écrit dans le message de
...
I have this routine that I am runing, but the problem is it changes all

the
tabs on every sheet, how can I have only change the tab for the sheet I am
working on?

Here is what I am using

Sub nametab()
Dim i As Integer
On Error Resume Next
For i = 1 To Sheets.Count
Sheets(i).Name = Sheets(i).Range("G1").Value
Next i
On Error GoTo 0

Any help would be great.




Chip Pearson

Naming The Tabsheet from a cell
 
Jack,

Try

ActiveSheet.Name = ActiveSheet.Range("G1").Value


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"JackR" wrote in message
...
I have this routine that I am runing, but the problem is it
changes all the
tabs on every sheet, how can I have only change the tab for the
sheet I am
working on?

Here is what I am using

Sub nametab()
Dim i As Integer
On Error Resume Next
For i = 1 To Sheets.Count
Sheets(i).Name = Sheets(i).Range("G1").Value
Next i
On Error GoTo 0

Any help would be great.




JackR

Naming The Tabsheet from a cell
 
Thank you, that worked. I appreciate the help

"Chip Pearson" wrote:

Jack,

Try

ActiveSheet.Name = ActiveSheet.Range("G1").Value


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"JackR" wrote in message
...
I have this routine that I am runing, but the problem is it
changes all the
tabs on every sheet, how can I have only change the tab for the
sheet I am
working on?

Here is what I am using

Sub nametab()
Dim i As Integer
On Error Resume Next
For i = 1 To Sheets.Count
Sheets(i).Name = Sheets(i).Range("G1").Value
Next i
On Error GoTo 0

Any help would be great.






All times are GMT +1. The time now is 12:52 PM.

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