#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 74
Default sheet name

is it possible to force a cell enty as a sheet name, i.e. i have a worksheet
that i use for quoting for clients. i wrote a macro that automatically put a
new number on each sheet when it duplicate the master sheet. i would like
that quote number in the worksheet, to be used as the sheet number for easy
reference
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default sheet name



ActiveSheet.name=Range("A1").value

Does that help?
Paul

--

"des-sa" wrote in message
...
is it possible to force a cell enty as a sheet name, i.e. i have a
worksheet
that i use for quoting for clients. i wrote a macro that automatically
put a
new number on each sheet when it duplicate the master sheet. i would like
that quote number in the worksheet, to be used as the sheet number for
easy
reference



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 74
Default sheet name

Paul,
You're working with stupidity here. Where should i enter that formula?
Thanks

"PCLIVE" wrote:



ActiveSheet.name=Range("A1").value

Does that help?
Paul

--

"des-sa" wrote in message
...
is it possible to force a cell enty as a sheet name, i.e. i have a
worksheet
that i use for quoting for clients. i wrote a macro that automatically
put a
new number on each sheet when it duplicate the master sheet. i would like
that quote number in the worksheet, to be used as the sheet number for
easy
reference




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default sheet name

This is VB (Visual Basic) code just like what a macro would use, not a
formula. Without the use of a UDF (User Defined Function) which is also
done through VB, then I don't know of a way to make the sheet name = the
contents of a specific cell upon enter a value in a cell, assuming that is
what you wanted to do.

Try this.

Press Alt+F11 to enter the VB Editor.
On the left, you should see your workbook listed as
"VBAProject(YourWorkbook)". If there is a plus to the left of it, click it
to make it a minus which expands the list as well. Do the same thing for
"Microsoft Excel Objects".
Double-click on ThisWorkbook.
Paste the following code in the right-hand pane.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Address = "$A$1" Then ActiveSheet.Name = Range("A1").Value
End Sub


This code assumes that you want the worksheet name to match the contents
that are in cell A1. If you want it to equal some other cell, then modify
as necessary. Keep in mind, this code will change the sheet name of the
active sheet to whatever is entered into A1. The code is triggered any time
the sheet is changed and the changed cell was A1. If you delete the
contents of A1, this code will result in error.

Let me know if this is what you were looking for.
Regards,
Paul

--

"des-sa" wrote in message
...
Paul,
You're working with stupidity here. Where should i enter that formula?
Thanks

"PCLIVE" wrote:



ActiveSheet.name=Range("A1").value

Does that help?
Paul

--

"des-sa" wrote in message
...
is it possible to force a cell enty as a sheet name, i.e. i have a
worksheet
that i use for quoting for clients. i wrote a macro that automatically
put a
new number on each sheet when it duplicate the master sheet. i would
like
that quote number in the worksheet, to be used as the sheet number for
easy
reference






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default sheet name

My mistake. That's not a UDF. I started on one theory and ended with
another. Also, to prevent the error that I mentioned, used this modified
code.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Address = "$A$1" And Range("A1").Value < "" Then ActiveSheet.Name
= Range("A1").Value
End Sub


HTH,
Paul

--

"PCLIVE" wrote in message
...
This is VB (Visual Basic) code just like what a macro would use, not a
formula. Without the use of a UDF (User Defined Function) which is also
done through VB, then I don't know of a way to make the sheet name = the
contents of a specific cell upon enter a value in a cell, assuming that is
what you wanted to do.

Try this.

Press Alt+F11 to enter the VB Editor.
On the left, you should see your workbook listed as
"VBAProject(YourWorkbook)". If there is a plus to the left of it, click
it to make it a minus which expands the list as well. Do the same thing
for "Microsoft Excel Objects".
Double-click on ThisWorkbook.
Paste the following code in the right-hand pane.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
If Target.Address = "$A$1" Then ActiveSheet.Name =
Range("A1").Value
End Sub


This code assumes that you want the worksheet name to match the contents
that are in cell A1. If you want it to equal some other cell, then modify
as necessary. Keep in mind, this code will change the sheet name of the
active sheet to whatever is entered into A1. The code is triggered any
time the sheet is changed and the changed cell was A1. If you delete the
contents of A1, this code will result in error.

Let me know if this is what you were looking for.
Regards,
Paul

--

"des-sa" wrote in message
...
Paul,
You're working with stupidity here. Where should i enter that formula?
Thanks

"PCLIVE" wrote:



ActiveSheet.name=Range("A1").value

Does that help?
Paul

--

"des-sa" wrote in message
...
is it possible to force a cell enty as a sheet name, i.e. i have a
worksheet
that i use for quoting for clients. i wrote a macro that
automatically
put a
new number on each sheet when it duplicate the master sheet. i would
like
that quote number in the worksheet, to be used as the sheet number for
easy
reference









  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 74
Default sheet name

PAUL,
CANT THANK YOU ENOUGH!!!!!!!!!!!!
GOT IT RIGHT.
DISRI

"PCLIVE" wrote:

My mistake. That's not a UDF. I started on one theory and ended with
another. Also, to prevent the error that I mentioned, used this modified
code.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Address = "$A$1" And Range("A1").Value < "" Then ActiveSheet.Name
= Range("A1").Value
End Sub


HTH,
Paul

--

"PCLIVE" wrote in message
...
This is VB (Visual Basic) code just like what a macro would use, not a
formula. Without the use of a UDF (User Defined Function) which is also
done through VB, then I don't know of a way to make the sheet name = the
contents of a specific cell upon enter a value in a cell, assuming that is
what you wanted to do.

Try this.

Press Alt+F11 to enter the VB Editor.
On the left, you should see your workbook listed as
"VBAProject(YourWorkbook)". If there is a plus to the left of it, click
it to make it a minus which expands the list as well. Do the same thing
for "Microsoft Excel Objects".
Double-click on ThisWorkbook.
Paste the following code in the right-hand pane.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
If Target.Address = "$A$1" Then ActiveSheet.Name =
Range("A1").Value
End Sub


This code assumes that you want the worksheet name to match the contents
that are in cell A1. If you want it to equal some other cell, then modify
as necessary. Keep in mind, this code will change the sheet name of the
active sheet to whatever is entered into A1. The code is triggered any
time the sheet is changed and the changed cell was A1. If you delete the
contents of A1, this code will result in error.

Let me know if this is what you were looking for.
Regards,
Paul

--

"des-sa" wrote in message
...
Paul,
You're working with stupidity here. Where should i enter that formula?
Thanks

"PCLIVE" wrote:



ActiveSheet.name=Range("A1").value

Does that help?
Paul

--

"des-sa" wrote in message
...
is it possible to force a cell enty as a sheet name, i.e. i have a
worksheet
that i use for quoting for clients. i wrote a macro that
automatically
put a
new number on each sheet when it duplicate the master sheet. i would
like
that quote number in the worksheet, to be used as the sheet number for
easy
reference








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
lookup single value in one sheet, return multiple results from theother sheet Chuck[_3_] Excel Worksheet Functions 1 April 4th 08 06:17 AM
"='sheet 1'!D4" auto fill sheet to sheet ='sheet 2'!D4 mistewalker Excel Worksheet Functions 5 January 6th 08 11:36 PM
create a formula in one sheet that would read data from separate sheet automatically QD Excel Discussion (Misc queries) 0 December 8th 06 04:17 AM
How do I select price from sheet.b where sheet.a part no = sheet.b Sonny Excel Worksheet Functions 4 April 4th 06 05:08 PM
relative sheet references ala sheet(-1)!B11 so I can copy a sheet. RonMc5 Excel Discussion (Misc queries) 9 February 3rd 05 12:51 AM


All times are GMT +1. The time now is 05:24 PM.

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"