Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 63
Default Dynamic + Fixed worksheet name

I want to name a worksheet with a fixed name, say "Total" and a dynamic cell value which will be a number. So, if the cell reference is A1, and the value of A1 is 37, the worksheet name would be "Total 37". The value in A1 would change, hence the dynamic.

I've found how to name the worksheet just for the cell value, but I need to combine the two.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Dynamic + Fixed worksheet name

Hi Micheal,

Am Tue, 24 May 2016 12:59:44 -0700 (PDT) schrieb michaelberrier:

I want to name a worksheet with a fixed name, say "Total" and a dynamic cell value which will be a number. So, if the cell reference is A1, and the value of A1 is 37, the worksheet name would be "Total 37". The value in A1 would change, hence the dynamic.


in the code module of the expected sheet:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(0, 0) < "A1" Then Exit Sub
ActiveSheet.Name = "Total " & Target.Value
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 63
Default Dynamic + Fixed worksheet name

On Tuesday, May 24, 2016 at 5:20:55 PM UTC-4, Claus Busch wrote:
Hi Micheal,

Am Tue, 24 May 2016 12:59:44 -0700 (PDT) schrieb michaelberrier:

I want to name a worksheet with a fixed name, say "Total" and a dynamic cell value which will be a number. So, if the cell reference is A1, and the value of A1 is 37, the worksheet name would be "Total 37". The value in A1 would change, hence the dynamic.


in the code module of the expected sheet:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(0, 0) < "A1" Then Exit Sub
ActiveSheet.Name = "Total " & Target.Value
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional


Ok, this will be an elementary question, but how do I get the private sub to run? I've tried doing a "Call" module, but it fails.
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Dynamic + Fixed worksheet name

Hi Michael,

Am Wed, 25 May 2016 06:38:06 -0700 (PDT) schrieb michaelberrier:

Ok, this will be an elementary question, but how do I get the private sub to run? I've tried doing a "Call" module, but it fails.


the macro runs when you change A1


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 63
Default Dynamic + Fixed worksheet name

On Wednesday, May 25, 2016 at 9:51:03 AM UTC-4, Claus Busch wrote:
Hi Michael,

Am Wed, 25 May 2016 06:38:06 -0700 (PDT) schrieb michaelberrier:

Ok, this will be an elementary question, but how do I get the private sub to run? I've tried doing a "Call" module, but it fails.


the macro runs when you change A1


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional


It does not change.


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 63
Default Dynamic + Fixed worksheet name

On Wednesday, May 25, 2016 at 5:23:46 PM UTC-4, michaelberrier wrote:
On Wednesday, May 25, 2016 at 9:51:03 AM UTC-4, Claus Busch wrote:
Hi Michael,

Am Wed, 25 May 2016 06:38:06 -0700 (PDT) schrieb michaelberrier:

Ok, this will be an elementary question, but how do I get the private sub to run? I've tried doing a "Call" module, but it fails.


the macro runs when you change A1


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional


It does not change.


Rather, the macro doesn't run when the reference cell changes
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 63
Default Dynamic + Fixed worksheet name

On Wednesday, May 25, 2016 at 5:25:48 PM UTC-4, michaelberrier wrote:
On Wednesday, May 25, 2016 at 5:23:46 PM UTC-4, michaelberrier wrote:
On Wednesday, May 25, 2016 at 9:51:03 AM UTC-4, Claus Busch wrote:
Hi Michael,

Am Wed, 25 May 2016 06:38:06 -0700 (PDT) schrieb michaelberrier:

Ok, this will be an elementary question, but how do I get the private sub to run? I've tried doing a "Call" module, but it fails.

the macro runs when you change A1


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional


It does not change.


Rather, the macro doesn't run when the reference cell changes


Ok, my error. The macro runs if their is an entered value in the reference cell. I'm trying to use a formula in that cell. Is that possible?
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Dynamic + Fixed worksheet name

Hi Michael,

Am Wed, 25 May 2016 14:28:08 -0700 (PDT) schrieb michaelberrier:

Ok, my error. The macro runs if their is an entered value in the reference cell. I'm trying to use a formula in that cell. Is that possible?


if you have a formula in A1 you have to use Worksheet_Calculate event:
Private Sub Worksheet_Calculate()
ActiveSheet.Name = "Total " & Range("A1").Value
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 63
Default Dynamic + Fixed worksheet name

On Wednesday, May 25, 2016 at 6:08:08 PM UTC-4, Claus Busch wrote:
Hi Michael,

Am Wed, 25 May 2016 14:28:08 -0700 (PDT) schrieb michaelberrier:

Ok, my error. The macro runs if their is an entered value in the reference cell. I'm trying to use a formula in that cell. Is that possible?


if you have a formula in A1 you have to use Worksheet_Calculate event:
Private Sub Worksheet_Calculate()
ActiveSheet.Name = "Total " & Range("A1").Value
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional


MONEY! Thank you sir.
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
run macro before closing if worksheet name is fixed Jaan Excel Programming 3 September 7th 09 09:46 AM
Speed of fixed array versus dynamic array Sing Excel Programming 8 November 18th 07 10:19 AM
Fixed decimals worksheet specific Charlotte Excel Worksheet Functions 7 September 14th 06 02:33 PM
UserForm TextBox with fixed Width and dynamic Height Soniya[_4_] Excel Programming 2 March 4th 06 08:38 AM
How to add a fixed point to a dynamic chart [email protected] Excel Programming 1 November 11th 05 01:16 PM


All times are GMT +1. The time now is 05:23 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"