Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Worksheet Name from Cell Value

I am building an excel template that uses a sheet as an entry form and
produces several sheets from the information entered. I want the worksheet
names to come from information entered into specific cells on the first sheet.

Many Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,646
Default Worksheet Name from Cell Value

ActiveSheet.Name = Range("A1") '<--CHANGE sheet and cell reference as
required!

Regards,
Stefi



€žEdcase€ť ezt Ă*rta:

I am building an excel template that uses a sheet as an entry form and
produces several sheets from the information entered. I want the worksheet
names to come from information entered into specific cells on the first sheet.

Many Thanks

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Worksheet Name from Cell Value

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1" '<===== Change to suit

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Me.Name = Target.Value
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.





--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Edcase" wrote in message
...
I am building an excel template that uses a sheet as an entry form and
produces several sheets from the information entered. I want the worksheet
names to come from information entered into specific cells on the first

sheet.

Many Thanks



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Worksheet Name from Cell Value

Thanks for the code , but it seems not to work. I copied the code straight
from your post and followed the instructions, saved the workbook and
alteredvalue in the cell and nothing. What could I be doing wrong?



"Bob Phillips" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1" '<===== Change to suit

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Me.Name = Target.Value
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.





--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Edcase" wrote in message
...
I am building an excel template that uses a sheet as an entry form and
produces several sheets from the information entered. I want the worksheet
names to come from information entered into specific cells on the first

sheet.

Many Thanks




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Worksheet Name from Cell Value

I've just tried it again and it works fine for me.

Put this line

MsgBox "WS Change event"

try again and see if it returns the MsgBox

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Edcase" wrote in message
...
Thanks for the code , but it seems not to work. I copied the code straight
from your post and followed the instructions, saved the workbook and
alteredvalue in the cell and nothing. What could I be doing wrong?



"Bob Phillips" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1" '<===== Change to suit

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Me.Name = Target.Value
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.





--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Edcase" wrote in message
...
I am building an excel template that uses a sheet as an entry form and
produces several sheets from the information entered. I want the

worksheet
names to come from information entered into specific cells on the

first
sheet.

Many Thanks








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 113
Default Worksheet Name from Cell Value

Bob...I am trying to do the same thing. The problem is when I enter in a
cell in a different sheet. For instance, I need the sheet name on sheet 3 to
be named what I enter in cell F2 on sheet 1. I can link a cell in sheet 3 to
the entry cell on sheet 1, however, I need to edit and enter the cell on
sheet 3 to get the sheet name to change. Bottom line: I want to enter a
descriptor on an entry sheet and have a specific sheet change name to what
was entered. Is this possible? Thanks!

"Bob Phillips" wrote:

I've just tried it again and it works fine for me.

Put this line

MsgBox "WS Change event"

try again and see if it returns the MsgBox

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Edcase" wrote in message
...
Thanks for the code , but it seems not to work. I copied the code straight
from your post and followed the instructions, saved the workbook and
alteredvalue in the cell and nothing. What could I be doing wrong?



"Bob Phillips" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1" '<===== Change to suit

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Me.Name = Target.Value
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.





--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Edcase" wrote in message
...
I am building an excel template that uses a sheet as an entry form and
produces several sheets from the information entered. I want the

worksheet
names to come from information entered into specific cells on the

first
sheet.

Many Thanks






  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Worksheet Name from Cell Value

How would you know which cell refers to which sheet? You need some linkage
for the code to base upon. I suppose you could always use, first sheet takes
A2, second takes B2, etc., but it needs user discipline not to move the
sheets around.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Deeds" wrote in message
...
Bob...I am trying to do the same thing. The problem is when I enter in a
cell in a different sheet. For instance, I need the sheet name on sheet 3

to
be named what I enter in cell F2 on sheet 1. I can link a cell in sheet 3

to
the entry cell on sheet 1, however, I need to edit and enter the cell on
sheet 3 to get the sheet name to change. Bottom line: I want to enter a
descriptor on an entry sheet and have a specific sheet change name to what
was entered. Is this possible? Thanks!

"Bob Phillips" wrote:

I've just tried it again and it works fine for me.

Put this line

MsgBox "WS Change event"

try again and see if it returns the MsgBox

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Edcase" wrote in message
...
Thanks for the code , but it seems not to work. I copied the code

straight
from your post and followed the instructions, saved the workbook and
alteredvalue in the cell and nothing. What could I be doing wrong?



"Bob Phillips" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1" '<===== Change to suit

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Me.Name = Target.Value
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.





--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Edcase" wrote in message
...
I am building an excel template that uses a sheet as an entry form

and
produces several sheets from the information entered. I want the

worksheet
names to come from information entered into specific cells on the

first
sheet.

Many Thanks








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
fill cell with color from other worksheet Crakel Excel Discussion (Misc queries) 4 April 19th 06 05:14 AM
Conversion of Cell Contents into a Functional Worksheet name ? GMJT Excel Worksheet Functions 1 August 21st 05 04:59 PM
macro help thephoenix12 Excel Discussion (Misc queries) 4 July 15th 05 05:57 PM
Refrencing another cell in a worksheet that "could" exist KimberlyC Excel Worksheet Functions 1 February 7th 05 07:09 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


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

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

About Us

"It's about Microsoft Excel"