#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 141
Default Workbook Macro

Hi,

How can I write this code to place in the workbook of the file, the macro
changes the sheet tab name as per the individual sheet cell A1 which is
changed from the first sheet Index of Stock, I am looking to do this so it
changes instantly when the name is changed and do not need to calculate each
sheet, I have over 100 sheets.

Here is the macro

Private Sub Worksheet_Calculate()
With Me.Range("A1")
If .Value < "" Then
Me.Name = .Value
End If
End With
End Sub

Many thanks

Mark
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Workbook Macro

Try this code instead...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Me.Name = Target.Value
End If
End Sub
--
HTH...

Jim Thomlinson


"terilad" wrote:

Hi,

How can I write this code to place in the workbook of the file, the macro
changes the sheet tab name as per the individual sheet cell A1 which is
changed from the first sheet Index of Stock, I am looking to do this so it
changes instantly when the name is changed and do not need to calculate each
sheet, I have over 100 sheets.

Here is the macro

Private Sub Worksheet_Calculate()
With Me.Range("A1")
If .Value < "" Then
Me.Name = .Value
End If
End With
End Sub

Many thanks

Mark

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 141
Default Workbook Macro

Hi Jim,

Not working for me. Any ideas

Mark

"Jim Thomlinson" wrote:

Try this code instead...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Me.Name = Target.Value
End If
End Sub
--
HTH...

Jim Thomlinson


"terilad" wrote:

Hi,

How can I write this code to place in the workbook of the file, the macro
changes the sheet tab name as per the individual sheet cell A1 which is
changed from the first sheet Index of Stock, I am looking to do this so it
changes instantly when the name is changed and do not need to calculate each
sheet, I have over 100 sheets.

Here is the macro

Private Sub Worksheet_Calculate()
With Me.Range("A1")
If .Value < "" Then
Me.Name = .Value
End If
End With
End Sub

Many thanks

Mark

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Workbook Macro

Is the value in cell A1 a formula? If so where is the precident cell to the
formula?
--
HTH...

Jim Thomlinson


"terilad" wrote:

Hi Jim,

Not working for me. Any ideas

Mark

"Jim Thomlinson" wrote:

Try this code instead...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Me.Name = Target.Value
End If
End Sub
--
HTH...

Jim Thomlinson


"terilad" wrote:

Hi,

How can I write this code to place in the workbook of the file, the macro
changes the sheet tab name as per the individual sheet cell A1 which is
changed from the first sheet Index of Stock, I am looking to do this so it
changes instantly when the name is changed and do not need to calculate each
sheet, I have over 100 sheets.

Here is the macro

Private Sub Worksheet_Calculate()
With Me.Range("A1")
If .Value < "" Then
Me.Name = .Value
End If
End With
End Sub

Many thanks

Mark



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 141
Default Workbook Macro

Hi Jim,

yes it is a formula, it is ='Index of Stock'!A3 and so on for all the sheets
so sheet 2 is ='Index of Stock'!A4 and so on for 100.

Regards

Mark

"Jim Thomlinson" wrote:

Is the value in cell A1 a formula? If so where is the precident cell to the
formula?
--
HTH...

Jim Thomlinson


"terilad" wrote:

Hi Jim,

Not working for me. Any ideas

Mark

"Jim Thomlinson" wrote:

Try this code instead...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Me.Name = Target.Value
End If
End Sub
--
HTH...

Jim Thomlinson


"terilad" wrote:

Hi,

How can I write this code to place in the workbook of the file, the macro
changes the sheet tab name as per the individual sheet cell A1 which is
changed from the first sheet Index of Stock, I am looking to do this so it
changes instantly when the name is changed and do not need to calculate each
sheet, I have over 100 sheets.

Here is the macro

Private Sub Worksheet_Calculate()
With Me.Range("A1")
If .Value < "" Then
Me.Name = .Value
End If
End With
End Sub

Many thanks

Mark

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Workbook Macro

Do you have an adequate answer in programming? Do we need to continue this
thread? You need to pick one thread to continue with...
--
HTH...

Jim Thomlinson


"terilad" wrote:

Hi Jim,

yes it is a formula, it is ='Index of Stock'!A3 and so on for all the sheets
so sheet 2 is ='Index of Stock'!A4 and so on for 100.

Regards

Mark

"Jim Thomlinson" wrote:

Is the value in cell A1 a formula? If so where is the precident cell to the
formula?
--
HTH...

Jim Thomlinson


"terilad" wrote:

Hi Jim,

Not working for me. Any ideas

Mark

"Jim Thomlinson" wrote:

Try this code instead...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Me.Name = Target.Value
End If
End Sub
--
HTH...

Jim Thomlinson


"terilad" wrote:

Hi,

How can I write this code to place in the workbook of the file, the macro
changes the sheet tab name as per the individual sheet cell A1 which is
changed from the first sheet Index of Stock, I am looking to do this so it
changes instantly when the name is changed and do not need to calculate each
sheet, I have over 100 sheets.

Here is the macro

Private Sub Worksheet_Calculate()
With Me.Range("A1")
If .Value < "" Then
Me.Name = .Value
End If
End With
End Sub

Many thanks

Mark

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 141
Default Workbook Macro

Hi Jim,

No adequate answer in programming, it doesn't work the suggestion that was
in programming.

Mark

"Jim Thomlinson" wrote:

Do you have an adequate answer in programming? Do we need to continue this
thread? You need to pick one thread to continue with...
--
HTH...

Jim Thomlinson


"terilad" wrote:

Hi Jim,

yes it is a formula, it is ='Index of Stock'!A3 and so on for all the sheets
so sheet 2 is ='Index of Stock'!A4 and so on for 100.

Regards

Mark

"Jim Thomlinson" wrote:

Is the value in cell A1 a formula? If so where is the precident cell to the
formula?
--
HTH...

Jim Thomlinson


"terilad" wrote:

Hi Jim,

Not working for me. Any ideas

Mark

"Jim Thomlinson" wrote:

Try this code instead...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Me.Name = Target.Value
End If
End Sub
--
HTH...

Jim Thomlinson


"terilad" wrote:

Hi,

How can I write this code to place in the workbook of the file, the macro
changes the sheet tab name as per the individual sheet cell A1 which is
changed from the first sheet Index of Stock, I am looking to do this so it
changes instantly when the name is changed and do not need to calculate each
sheet, I have over 100 sheets.

Here is the macro

Private Sub Worksheet_Calculate()
With Me.Range("A1")
If .Value < "" Then
Me.Name = .Value
End If
End With
End Sub

Many thanks

Mark

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
saving macro from workbook to Personal Macro Workbook KrispyData Excel Discussion (Misc queries) 1 March 25th 10 05:52 PM
Combine worksheets in multiple workbook in one workbook with a macro Sam Commar Excel Discussion (Misc queries) 2 April 2nd 09 01:09 PM
Macro to copy an image (or picture) from one workbook to a new sheetin another workbook Ruchir Excel Worksheet Functions 1 July 25th 08 07:29 AM
need help to update macro to office 2007 macro enabled workbook jatman Excel Discussion (Misc queries) 1 December 14th 07 01:57 PM
Runing a macro in a workbook from another macro in other workbook dhatul Excel Discussion (Misc queries) 0 January 13th 06 06:27 AM


All times are GMT +1. The time now is 08:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"