I am very much a novice with using Excel, I'd prefer to be doing this
in Access as that's what the data's aimed at in the long run, but the
db I'm being forced to use is not mine and I can't work that out
either - also work don't support Access so I can't use that to do the
data transfer I'm being asked to do... oh why did I say I'd do this :(

Down to the true business...

I have created a workbook and am trying to name the sheets from cells
in another sheet - all within the same workbook.

I have been digging about the net and everything I've found that looks
to be nearly right doesn't work :(

Anyone out there willing to try to help me with this one ?

Re: How to name a sheet from text in a cell in another sheet ? by Ross

Ross
Wed Apr 16 13:47:33 CDT 2008

Nick, your question is almost impossible to decipher. However, you can
certainly use VBA to accomplish what your after, that is, if you're trying
to programmatically rename or add sheets based off a list of values on a
sheet.

Please describe more clearly what you're trying to accomplish.

Ross


"NickTheBatMan" <nickw7coc@gmail.com> wrote in message
news:75c438c5-9ffb-4ed9-a83e-3f62b86cd07f@l64g2000hse.googlegroups.com...
>I am very much a novice with using Excel, I'd prefer to be doing this
> in Access as that's what the data's aimed at in the long run, but the
> db I'm being forced to use is not mine and I can't work that out
> either - also work don't support Access so I can't use that to do the
> data transfer I'm being asked to do... oh why did I say I'd do this :(
>
> Down to the true business...
>
> I have created a workbook and am trying to name the sheets from cells
> in another sheet - all within the same workbook.
>
> I have been digging about the net and everything I've found that looks
> to be nearly right doesn't work :(
>
> Anyone out there willing to try to help me with this one ?



Re: How to name a sheet from text in a cell in another sheet ? by NickTheBatMan

NickTheBatMan
Wed Apr 16 14:05:57 CDT 2008

On Apr 16, 7:47 pm, "Ross Culver" <rcul...@warrenalloy.com> wrote:
> Nick, your question is almost impossible to decipher. However, you can
> certainly use VBA to accomplish what your after, that is, if you're trying
> to programmatically rename or add sheets based off a list of values on a
> sheet.
>
> Please describe more clearly what you're trying to accomplish.
>
> Ross
>
> "NickTheBatMan" <nickw7...@gmail.com> wrote in message
>
> news:75c438c5-9ffb-4ed9-a83e-3f62b86cd07f@l64g2000hse.googlegroups.com...
>
> >I am very much a novice with using Excel, I'd prefer to be doing this
> > in Access as that's what the data's aimed at in the long run, but the
> > db I'm being forced to use is not mine and I can't work that out
> > either - also work don't support Access so I can't use that to do the
> > data transfer I'm being asked to do... oh why did I say I'd do this :(
>
> > Down to the true business...
>
> > I have created a workbook and am trying to name the sheets from cells
> > in another sheet - all within the same workbook.
>
> > I have been digging about the net and everything I've found that looks
> > to be nearly right doesn't work :(
>
> > Anyone out there willing to try to help me with this one ?

Ok Ross, I'll try again.

What I've got is a worksheet called Headers and I've put names in
cells on it - that's cells B1 to B4 through to H1 to H4.

I have created 24 sheets to reflect these cells and wish to name the
sheets by the characters entered into these cells - I am also using
the words in the cells in this Headers sheet to populate other cells
in yet another sheet called Links.

The info I'm putting into the cells in the other sheets is going to be
reflected in the Links Sheet by having the correct cell in the linked
sheets reflected in this Links one, then the data in the Links sheet
is going to be used to populate the Access database so that the layout
reflects what we want...

As I said, it's all for this database which is not mine and massively
more complex than just this...

Sorry it's so complex, I do hope you follow this ?

Thanks for attempting to aid me...

Nick

Re: How to name a sheet from text in a cell in another sheet ? by Otto

Otto
Wed Apr 16 14:22:08 CDT 2008

Nick
This little macro will rename every sheet in the file by the list you
have. It will not rename the "Headers" or "Links" sheets. HTH Otto
Sub RenameExistingSheets()
Dim rSheetNames As Range
Dim ws As Worksheet
Dim c As Long
Application.ScreenUpdating = False
c = 1
Sheets("Headers").Select
Set rSheetNames = Range("B1:H4")
For Each ws In ActiveWorkbook.Worksheets
If ws.Name <> "Headers" And ws.Name <> "Links" Then
ws.Name = rSheetNames(c).Value
c = c + 1
End If
Next ws
Application.ScreenUpdating = True
End Sub
"NickTheBatMan" <nickw7coc@gmail.com> wrote in message
news:98ae337f-588b-41be-ae7a-0fb83536969c@m73g2000hsh.googlegroups.com...
> On Apr 16, 7:47 pm, "Ross Culver" <rcul...@warrenalloy.com> wrote:
>> Nick, your question is almost impossible to decipher. However, you can
>> certainly use VBA to accomplish what your after, that is, if you're
>> trying
>> to programmatically rename or add sheets based off a list of values on a
>> sheet.
>>
>> Please describe more clearly what you're trying to accomplish.
>>
>> Ross
>>
>> "NickTheBatMan" <nickw7...@gmail.com> wrote in message
>>
>> news:75c438c5-9ffb-4ed9-a83e-3f62b86cd07f@l64g2000hse.googlegroups.com...
>>
>> >I am very much a novice with using Excel, I'd prefer to be doing this
>> > in Access as that's what the data's aimed at in the long run, but the
>> > db I'm being forced to use is not mine and I can't work that out
>> > either - also work don't support Access so I can't use that to do the
>> > data transfer I'm being asked to do... oh why did I say I'd do this :(
>>
>> > Down to the true business...
>>
>> > I have created a workbook and am trying to name the sheets from cells
>> > in another sheet - all within the same workbook.
>>
>> > I have been digging about the net and everything I've found that looks
>> > to be nearly right doesn't work :(
>>
>> > Anyone out there willing to try to help me with this one ?
>
> Ok Ross, I'll try again.
>
> What I've got is a worksheet called Headers and I've put names in
> cells on it - that's cells B1 to B4 through to H1 to H4.
>
> I have created 24 sheets to reflect these cells and wish to name the
> sheets by the characters entered into these cells - I am also using
> the words in the cells in this Headers sheet to populate other cells
> in yet another sheet called Links.
>
> The info I'm putting into the cells in the other sheets is going to be
> reflected in the Links Sheet by having the correct cell in the linked
> sheets reflected in this Links one, then the data in the Links sheet
> is going to be used to populate the Access database so that the layout
> reflects what we want...
>
> As I said, it's all for this database which is not mine and massively
> more complex than just this...
>
> Sorry it's so complex, I do hope you follow this ?
>
> Thanks for attempting to aid me...
>
> Nick



Re: How to name a sheet from text in a cell in another sheet ? by Ross

Ross
Wed Apr 16 14:37:16 CDT 2008

It would be better if all the names were in one column instead of spread
across A-H, but try something like this using VBA. I'm making some
assumptions here that might be wrong, such as:

1) The first sheet you need to rename is already named Sheet2 (presumably,
Sheet1 is the one you changed to "Headers").
2) You want to name the sheets the entire value that's in each cell. If
not, parse out what you do want to use.
3) That you have, indeed, already created the additional sheets.
Otherwise, I would have used code to add each sheet as needed.

This might not be exactly what you need, but will hopefully lead you in the
right direction.

private sub NameSheets
dim X as integer, SheetName as string
X = 1

'For col A
do while X < 5
SheetName = Sheets("Headers").range("A" & x).value
Sheets(x + 1).name = sheetname
X = X + 1
loop

X = 1
'For col B
do while X < 5
SheetName = Sheets("Headers").range("B" & x).value
Sheets(x + 5).name = sheetname
X = X + 1
loop

X = 1
'For col C
do while X < 5
SheetName = Sheets("Headers").range("C" & x).value
Sheets(x + 10).name = sheetname
X = X + 1
loop

etc.

end sub


"NickTheBatMan" <nickw7coc@gmail.com> wrote in message
news:98ae337f-588b-41be-ae7a-0fb83536969c@m73g2000hsh.googlegroups.com...
> On Apr 16, 7:47 pm, "Ross Culver" <rcul...@warrenalloy.com> wrote:
>> Nick, your question is almost impossible to decipher. However, you can
>> certainly use VBA to accomplish what your after, that is, if you're
>> trying
>> to programmatically rename or add sheets based off a list of values on a
>> sheet.
>>
>> Please describe more clearly what you're trying to accomplish.
>>
>> Ross
>>
>> "NickTheBatMan" <nickw7...@gmail.com> wrote in message
>>
>> news:75c438c5-9ffb-4ed9-a83e-3f62b86cd07f@l64g2000hse.googlegroups.com...
>>
>> >I am very much a novice with using Excel, I'd prefer to be doing this
>> > in Access as that's what the data's aimed at in the long run, but the
>> > db I'm being forced to use is not mine and I can't work that out
>> > either - also work don't support Access so I can't use that to do the
>> > data transfer I'm being asked to do... oh why did I say I'd do this :(
>>
>> > Down to the true business...
>>
>> > I have created a workbook and am trying to name the sheets from cells
>> > in another sheet - all within the same workbook.
>>
>> > I have been digging about the net and everything I've found that looks
>> > to be nearly right doesn't work :(
>>
>> > Anyone out there willing to try to help me with this one ?
>
> Ok Ross, I'll try again.
>
> What I've got is a worksheet called Headers and I've put names in
> cells on it - that's cells B1 to B4 through to H1 to H4.
>
> I have created 24 sheets to reflect these cells and wish to name the
> sheets by the characters entered into these cells - I am also using
> the words in the cells in this Headers sheet to populate other cells
> in yet another sheet called Links.
>
> The info I'm putting into the cells in the other sheets is going to be
> reflected in the Links Sheet by having the correct cell in the linked
> sheets reflected in this Links one, then the data in the Links sheet
> is going to be used to populate the Access database so that the layout
> reflects what we want...
>
> As I said, it's all for this database which is not mine and massively
> more complex than just this...
>
> Sorry it's so complex, I do hope you follow this ?
>
> Thanks for attempting to aid me...
>
> Nick



Re: How to name a sheet from text in a cell in another sheet ? by Ross

Ross
Wed Apr 16 14:40:40 CDT 2008

Yes, I like the use of the range even better!

Ross

"Otto Moehrbach" <moehrbachoextra@bellsouth.net> wrote in message
news:OCnrsc$nIHA.2292@TK2MSFTNGP03.phx.gbl...
> Nick
> This little macro will rename every sheet in the file by the list you
> have. It will not rename the "Headers" or "Links" sheets. HTH Otto
> Sub RenameExistingSheets()
> Dim rSheetNames As Range
> Dim ws As Worksheet
> Dim c As Long
> Application.ScreenUpdating = False
> c = 1
> Sheets("Headers").Select
> Set rSheetNames = Range("B1:H4")
> For Each ws In ActiveWorkbook.Worksheets
> If ws.Name <> "Headers" And ws.Name <> "Links" Then
> ws.Name = rSheetNames(c).Value
> c = c + 1
> End If
> Next ws
> Application.ScreenUpdating = True
> End Sub
> "NickTheBatMan" <nickw7coc@gmail.com> wrote in message
> news:98ae337f-588b-41be-ae7a-0fb83536969c@m73g2000hsh.googlegroups.com...
>> On Apr 16, 7:47 pm, "Ross Culver" <rcul...@warrenalloy.com> wrote:
>>> Nick, your question is almost impossible to decipher. However, you can
>>> certainly use VBA to accomplish what your after, that is, if you're
>>> trying
>>> to programmatically rename or add sheets based off a list of values on a
>>> sheet.
>>>
>>> Please describe more clearly what you're trying to accomplish.
>>>
>>> Ross
>>>
>>> "NickTheBatMan" <nickw7...@gmail.com> wrote in message
>>>
>>> news:75c438c5-9ffb-4ed9-a83e-3f62b86cd07f@l64g2000hse.googlegroups.com...
>>>
>>> >I am very much a novice with using Excel, I'd prefer to be doing this
>>> > in Access as that's what the data's aimed at in the long run, but the
>>> > db I'm being forced to use is not mine and I can't work that out
>>> > either - also work don't support Access so I can't use that to do the
>>> > data transfer I'm being asked to do... oh why did I say I'd do this :(
>>>
>>> > Down to the true business...
>>>
>>> > I have created a workbook and am trying to name the sheets from cells
>>> > in another sheet - all within the same workbook.
>>>
>>> > I have been digging about the net and everything I've found that looks
>>> > to be nearly right doesn't work :(
>>>
>>> > Anyone out there willing to try to help me with this one ?
>>
>> Ok Ross, I'll try again.
>>
>> What I've got is a worksheet called Headers and I've put names in
>> cells on it - that's cells B1 to B4 through to H1 to H4.
>>
>> I have created 24 sheets to reflect these cells and wish to name the
>> sheets by the characters entered into these cells - I am also using
>> the words in the cells in this Headers sheet to populate other cells
>> in yet another sheet called Links.
>>
>> The info I'm putting into the cells in the other sheets is going to be
>> reflected in the Links Sheet by having the correct cell in the linked
>> sheets reflected in this Links one, then the data in the Links sheet
>> is going to be used to populate the Access database so that the layout
>> reflects what we want...
>>
>> As I said, it's all for this database which is not mine and massively
>> more complex than just this...
>>
>> Sorry it's so complex, I do hope you follow this ?
>>
>> Thanks for attempting to aid me...
>>
>> Nick
>
>



Re: How to name a sheet from text in a cell in another sheet ? by NickTheBatMan

NickTheBatMan
Wed Apr 16 16:08:38 CDT 2008

On Apr 16, 8:22 pm, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
wrote:
> Nick
> This little macro will rename every sheet in the file by the list you
> have. It will not rename the "Headers" or "Links" sheets. HTH Otto
> Sub RenameExistingSheets()
> Dim rSheetNames As Range
> Dim ws As Worksheet
> Dim c As Long
> Application.ScreenUpdating = False
> c = 1
> Sheets("Headers").Select
> Set rSheetNames = Range("B1:H4")
> For Each ws In ActiveWorkbook.Worksheets
> If ws.Name <> "Headers" And ws.Name <> "Links" Then
> ws.Name = rSheetNames(c).Value
> c = c + 1
> End If
> Next ws
> Application.ScreenUpdating = True
> End Sub

Thanks you Otto, where do I put it ?

Just off to bed at 22:00 for the first of four 05:00 alarms for work !
Shall catch up tomorrow through Google Groups...
Nick

Re: How to name a sheet from text in a cell in another sheet ? by Otto

Otto
Wed Apr 16 17:36:32 CDT 2008

Nick
Make a copy of your file and do all this on the copy until you feel
comfortable with it and it's doing what you want.
With your file on the screen, do Alt-F11. This takes you to the VBE
(Visual Basic Editor). On the left side of the VBE should be a pane labeled
Project - VBA Project. If it's not there, click on View - Project Explorer.
Find your file name in the Project Explorer and click on it. Do Insert -
Module. This brings up a larger blank pane on the right. Paste the macro
there. "X" out of the VBE to return to your sheet.
Note that the macro name is RenameExistingSheets.
Click on Tools - Macro - Macros. Find the name of the macro. Click on it.
Click on Run. See what happens. If you feel shaky doing this, send me your
file and I'll place the macro for you and maybe give you a button in the
Header sheet that you can click on to run the macro. My email is
moehrbachoextra@bellsouth.net. Remove the "extra" from this address. HTH
Otto
"NickTheBatMan" <nickw7coc@gmail.com> wrote in message
news:75e8a73f-01ac-4eaf-85c2-8bc1c959d527@8g2000hsu.googlegroups.com...
> On Apr 16, 8:22 pm, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
> wrote:
>> Nick
>> This little macro will rename every sheet in the file by the list you
>> have. It will not rename the "Headers" or "Links" sheets. HTH Otto
>> Sub RenameExistingSheets()
>> Dim rSheetNames As Range
>> Dim ws As Worksheet
>> Dim c As Long
>> Application.ScreenUpdating = False
>> c = 1
>> Sheets("Headers").Select
>> Set rSheetNames = Range("B1:H4")
>> For Each ws In ActiveWorkbook.Worksheets
>> If ws.Name <> "Headers" And ws.Name <> "Links" Then
>> ws.Name = rSheetNames(c).Value
>> c = c + 1
>> End If
>> Next ws
>> Application.ScreenUpdating = True
>> End Sub
>
> Thanks you Otto, where do I put it ?
>
> Just off to bed at 22:00 for the first of four 05:00 alarms for work !
> Shall catch up tomorrow through Google Groups...
> Nick



Re: How to name a sheet from text in a cell in another sheet ? by NickTheBatMan

NickTheBatMan
Thu Apr 17 07:08:35 CDT 2008

Many thanks Otto, that works - sort of... :)

I was hoping that it may work after I had changed the contents of the
cell and come out of it...

The problem I now have is that I have Run-time error '1004'
That means I have over 31 characters and there are ones that
contravene the : \ / * [ ] rule for naming the sheets...
I'll have to rethink the wording of the buttons - or just do it
manually...

Nick

On 16 Apr, 23:36, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
wrote:
> Nick
> =A0 =A0 Make a copy of your file and do all this on the copy until you fee=
l
> comfortable with it and it's doing what you want.
> =A0 =A0 With your file on the screen, do Alt-F11. =A0This takes you to the=
VBE
> (Visual Basic Editor). =A0On the left side of the VBE should be a pane lab=
eled
> Project - VBA Project. =A0If it's not there, click on View - Project Explo=
rer.
> Find your file name in the Project Explorer and click on it. =A0Do Insert =
-
> Module. =A0This brings up a larger blank pane on the right. =A0Paste the m=
acro
> there. =A0"X" out of the VBE to return to your sheet.
> Note that the macro name is RenameExistingSheets.
> Click on Tools - Macro - Macros. =A0Find the name of the macro. =A0Click o=
n it.
> Click on Run. =A0See what happens. =A0If you feel shaky doing this, send m=
e your
> file and I'll place the macro for you and maybe give you a button in the
> Header sheet that you can click on to run the macro. =A0My email is
> moehrbachoex...@bellsouth.net. =A0Remove the "extra" from this address. =
=A0HTH
> Otto"NickTheBatMan" <nickw7...@gmail.com> wrote in message
>
> news:75e8a73f-01ac-4eaf-85c2-8bc1c959d527@8g2000hsu.googlegroups.com...
>
>
>
> > On Apr 16, 8:22 pm, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
> > wrote:
> >> Nick
> >> =A0 =A0 This little macro will rename every sheet in the file by the li=
st you
> >> have. =A0It will not rename the "Headers" or "Links" sheets. =A0HTH =A0=
Otto
> >> Sub RenameExistingSheets()
> >> =A0 =A0 =A0 Dim rSheetNames As Range
> >> =A0 =A0 =A0 Dim ws As Worksheet
> >> =A0 =A0 =A0 Dim c As Long
> >> =A0 =A0 =A0 Application.ScreenUpdating =3D False
> >> =A0 =A0 =A0 c =3D 1
> >> =A0 =A0 =A0 Sheets("Headers").Select
> >> =A0 =A0 =A0 Set rSheetNames =3D Range("B1:H4")
> >> =A0 =A0 =A0 For Each ws In ActiveWorkbook.Worksheets
> >> =A0 =A0 =A0 =A0 =A0 =A0 If ws.Name <> "Headers" And ws.Name <> "Links" =
Then
> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ws.Name =3D rSheetNames(c).Value
> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 c =3D c + 1
> >> =A0 =A0 =A0 =A0 =A0 =A0 End If
> >> =A0 =A0 =A0 Next ws
> >> =A0 =A0 =A0 Application.ScreenUpdating =3D True
> >> End Sub
>
> > Thanks you Otto, where do I put it ?
>
> > Just off to bed at 22:00 for the first of four 05:00 alarms for work !
> > Shall catch up tomorrow through Google Groups...
> > Nick- Hide quoted text -
>
> - Show quoted text -


Re: How to name a sheet from text in a cell in another sheet ? by Otto

Otto
Thu Apr 17 08:02:42 CDT 2008

Nick
What do you mean by "I was hoping that it may work after I had changed
the contents of the cell and come out of it...". What cell? In what sheet?
Do you mean you wanted the code to fire when you changed the entry in some
cell? That's easy enough to do.
What buttons? Otto

"NickTheBatMan" <nickw7coc@gmail.com> wrote in message
news:c4bd6aab-7581-4f6f-8b6e-d825359de93c@l64g2000hse.googlegroups.com...
Many thanks Otto, that works - sort of... :)

I was hoping that it may work after I had changed the contents of the
cell and come out of it...

The problem I now have is that I have Run-time error '1004'
That means I have over 31 characters and there are ones that
contravene the : \ / * [ ] rule for naming the sheets...
I'll have to rethink the wording of the buttons - or just do it
manually...

Nick

On 16 Apr, 23:36, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
wrote:
> Nick
> Make a copy of your file and do all this on the copy until you feel
> comfortable with it and it's doing what you want.
> With your file on the screen, do Alt-F11. This takes you to the VBE
> (Visual Basic Editor). On the left side of the VBE should be a pane
> labeled
> Project - VBA Project. If it's not there, click on View - Project
> Explorer.
> Find your file name in the Project Explorer and click on it. Do Insert -
> Module. This brings up a larger blank pane on the right. Paste the macro
> there. "X" out of the VBE to return to your sheet.
> Note that the macro name is RenameExistingSheets.
> Click on Tools - Macro - Macros. Find the name of the macro. Click on it.
> Click on Run. See what happens. If you feel shaky doing this, send me your
> file and I'll place the macro for you and maybe give you a button in the
> Header sheet that you can click on to run the macro. My email is
> moehrbachoex...@bellsouth.net. Remove the "extra" from this address. HTH
> Otto"NickTheBatMan" <nickw7...@gmail.com> wrote in message
>
> news:75e8a73f-01ac-4eaf-85c2-8bc1c959d527@8g2000hsu.googlegroups.com...
>
>
>
> > On Apr 16, 8:22 pm, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
> > wrote:
> >> Nick
> >> This little macro will rename every sheet in the file by the list you
> >> have. It will not rename the "Headers" or "Links" sheets. HTH Otto
> >> Sub RenameExistingSheets()
> >> Dim rSheetNames As Range
> >> Dim ws As Worksheet
> >> Dim c As Long
> >> Application.ScreenUpdating = False
> >> c = 1
> >> Sheets("Headers").Select
> >> Set rSheetNames = Range("B1:H4")
> >> For Each ws In ActiveWorkbook.Worksheets
> >> If ws.Name <> "Headers" And ws.Name <> "Links" Then
> >> ws.Name = rSheetNames(c).Value
> >> c = c + 1
> >> End If
> >> Next ws
> >> Application.ScreenUpdating = True
> >> End Sub
>
> > Thanks you Otto, where do I put it ?
>
> > Just off to bed at 22:00 for the first of four 05:00 alarms for work !
> > Shall catch up tomorrow through Google Groups...
> > Nick- Hide quoted text -
>
> - Show quoted text -



Re: How to name a sheet from text in a cell in another sheet ? by NickTheBatMan

NickTheBatMan
Thu Apr 17 10:26:59 CDT 2008

On 17 Apr, 14:02, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
wrote:
> Nick
> =A0 =A0 What do you mean by "I was hoping that it may work after I had cha=
nged
> the contents of the cell and come out of it...". =A0What cell? =A0In what =
sheet?
> Do you mean you wanted the code to fire when you changed the entry in some=

> cell? =A0That's easy enough to do.
> What buttons? =A0Otto
>
> "NickTheBatMan" <nickw7...@gmail.com> wrote in message
>
> news:c4bd6aab-7581-4f6f-8b6e-d825359de93c@l64g2000hse.googlegroups.com...
> Many thanks Otto, that works - sort of... :)
>
> I was hoping that it may work after I had changed the contents of the
> cell and come out of it...
>
> The problem I now have is that I have Run-time error '1004'
> That means I have over 31 characters and there are ones that
> contravene the : \ / * [ ] rule for naming the sheets...
> I'll have to rethink the wording of the buttons - or just do it
> manually...
>
> Nick
>
> On 16 Apr, 23:36, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
> wrote:
>
>
>
> > Nick
> > Make a copy of your file and do all this on the copy until you feel
> > comfortable with it and it's doing what you want.
> > With your file on the screen, do Alt-F11. This takes you to the VBE
> > (Visual Basic Editor). On the left side of the VBE should be a pane
> > labeled
> > Project - VBA Project. If it's not there, click on View - Project
> > Explorer.
> > Find your file name in the Project Explorer and click on it. Do Insert -=

> > Module. This brings up a larger blank pane on the right. Paste the macro=

> > there. "X" out of the VBE to return to your sheet.
> > Note that the macro name is RenameExistingSheets.
> > Click on Tools - Macro - Macros. Find the name of the macro. Click on it=
.
> > Click on Run. See what happens. If you feel shaky doing this, send me yo=
ur
> > file and I'll place the macro for you and maybe give you a button in the=

> > Header sheet that you can click on to run the macro. My email is
> > moehrbachoex...@bellsouth.net. Remove the "extra" from this address. HTH=

> > Otto"NickTheBatMan" <nickw7...@gmail.com> wrote in message
>
> >news:75e8a73f-01ac-4eaf-85c2-8bc1c959d527@8g2000hsu.googlegroups.com...
>
> > > On Apr 16, 8:22 pm, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
> > > wrote:
> > >> Nick
> > >> This little macro will rename every sheet in the file by the list you=

> > >> have. It will not rename the "Headers" or "Links" sheets. HTH Otto
> > >> Sub RenameExistingSheets()
> > >> Dim rSheetNames As Range
> > >> Dim ws As Worksheet
> > >> Dim c As Long
> > >> Application.ScreenUpdating =3D False
> > >> c =3D 1
> > >> Sheets("Headers").Select
> > >> Set rSheetNames =3D Range("B1:H4")
> > >> For Each ws In ActiveWorkbook.Worksheets
> > >> If ws.Name <> "Headers" And ws.Name <> "Links" Then
> > >> ws.Name =3D rSheetNames(c).Value
> > >> c =3D c + 1
> > >> End If
> > >> Next ws
> > >> Application.ScreenUpdating =3D True
> > >> End Sub
>
> > > Thanks you Otto, where do I put it ?
>
> > > Just off to bed at 22:00 for the first of four 05:00 alarms for work !=

> > > Shall catch up tomorrow through Google Groups...
> > > Nick- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

Hi Otto, sorry about that, getting mixed up between what I'm doing and
trying to do... if you look back in the thread you'll see that I'm
doing this instead of doing it in Access !

I have a sheet called Headers that I'm using to enter data into cells
and using that to refer to in these other sheets so that I only have
to alter one cell to get them all to be the same - this is the same
cell that I'm hoping to use to name the different sheets...

I meant cell when I typed button, it's going to end up being a button
in a form in Access when I've finished... I'm stuck to using Excel to
prove the layout and procude another list in another sheet of this
book which I'll be using to update the Access table
eventually...................................... oh why do I let
myself in fot this sort of thing ! :) :(

Re: How to name a sheet from text in a cell in another sheet ? by Otto

Otto
Thu Apr 17 15:33:25 CDT 2008

Nick
Up until now I thought I understood what you wanted. But now, I don't
know. You say:
"I have a sheet called Headers that I'm using to enter data into cells
and using that to refer to in these other sheets so that I only have
to alter one cell to get them all to be the same - this is the same
cell that I'm hoping to use to name the different sheets...".
I thought that you had a range of cells, B1:H4, with a text entry in each
cell. That you wanted a bunch of your existing sheets named the names in
this list, one name per sheet. What do you mean by "so that I only have to
alter one cell to get them all to be the same"??
Perhaps it would be better if you just write down a step-by-step procedure
of how you would do this if you were doing it manually. Leave nothing out!
Otto

"NickTheBatMan" <nickw7coc@gmail.com> wrote in message
news:2321560a-1e8c-4783-8ef6-d02cc56a4709@y21g2000hsf.googlegroups.com...
On 17 Apr, 14:02, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
wrote:
> Nick
> What do you mean by "I was hoping that it may work after I had changed
> the contents of the cell and come out of it...". What cell? In what sheet?
> Do you mean you wanted the code to fire when you changed the entry in some
> cell? That's easy enough to do.
> What buttons? Otto
>
> "NickTheBatMan" <nickw7...@gmail.com> wrote in message
>
> news:c4bd6aab-7581-4f6f-8b6e-d825359de93c@l64g2000hse.googlegroups.com...
> Many thanks Otto, that works - sort of... :)
>
> I was hoping that it may work after I had changed the contents of the
> cell and come out of it...
>
> The problem I now have is that I have Run-time error '1004'
> That means I have over 31 characters and there are ones that
> contravene the : \ / * [ ] rule for naming the sheets...
> I'll have to rethink the wording of the buttons - or just do it
> manually...
>
> Nick
>
> On 16 Apr, 23:36, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
> wrote:
>
>
>
> > Nick
> > Make a copy of your file and do all this on the copy until you feel
> > comfortable with it and it's doing what you want.
> > With your file on the screen, do Alt-F11. This takes you to the VBE
> > (Visual Basic Editor). On the left side of the VBE should be a pane
> > labeled
> > Project - VBA Project. If it's not there, click on View - Project
> > Explorer.
> > Find your file name in the Project Explorer and click on it. Do Insert -
> > Module. This brings up a larger blank pane on the right. Paste the macro
> > there. "X" out of the VBE to return to your sheet.
> > Note that the macro name is RenameExistingSheets.
> > Click on Tools - Macro - Macros. Find the name of the macro. Click on
> > it.
> > Click on Run. See what happens. If you feel shaky doing this, send me
> > your
> > file and I'll place the macro for you and maybe give you a button in the
> > Header sheet that you can click on to run the macro. My email is
> > moehrbachoex...@bellsouth.net. Remove the "extra" from this address. HTH
> > Otto"NickTheBatMan" <nickw7...@gmail.com> wrote in message
>
> >news:75e8a73f-01ac-4eaf-85c2-8bc1c959d527@8g2000hsu.googlegroups.com...
>
> > > On Apr 16, 8:22 pm, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
> > > wrote:
> > >> Nick
> > >> This little macro will rename every sheet in the file by the list you
> > >> have. It will not rename the "Headers" or "Links" sheets. HTH Otto
> > >> Sub RenameExistingSheets()
> > >> Dim rSheetNames As Range
> > >> Dim ws As Worksheet
> > >> Dim c As Long
> > >> Application.ScreenUpdating = False
> > >> c = 1
> > >> Sheets("Headers").Select
> > >> Set rSheetNames = Range("B1:H4")
> > >> For Each ws In ActiveWorkbook.Worksheets
> > >> If ws.Name <> "Headers" And ws.Name <> "Links" Then
> > >> ws.Name = rSheetNames(c).Value
> > >> c = c + 1
> > >> End If
> > >> Next ws
> > >> Application.ScreenUpdating = True
> > >> End Sub
>
> > > Thanks you Otto, where do I put it ?
>
> > > Just off to bed at 22:00 for the first of four 05:00 alarms for work !
> > > Shall catch up tomorrow through Google Groups...
> > > Nick- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

Hi Otto, sorry about that, getting mixed up between what I'm doing and
trying to do... if you look back in the thread you'll see that I'm
doing this instead of doing it in Access !

I have a sheet called Headers that I'm using to enter data into cells
and using that to refer to in these other sheets so that I only have
to alter one cell to get them all to be the same - this is the same
cell that I'm hoping to use to name the different sheets...

I meant cell when I typed button, it's going to end up being a button
in a form in Access when I've finished... I'm stuck to using Excel to
prove the layout and procude another list in another sheet of this
book which I'll be using to update the Access table
eventually...................................... oh why do I let
myself in fot this sort of thing ! :) :(



Re: How to name a sheet from text in a cell in another sheet ? by NickTheBatMan

NickTheBatMan
Fri Apr 18 09:39:30 CDT 2008

On 17 Apr, 21:33, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
wrote:
> Nick
> =A0 =A0 Up until now I thought I understood what you wanted. =A0But now, I=
don't
> know. =A0You say:
> "I have a sheet called Headers that I'm using to enter data into cells
> and using that to refer to in these other sheets so that I only have
> to alter one cell to get them all to be the same - this is the same
> cell that I'm hoping to use to name the different sheets...".
> I thought that you had a range of cells, B1:H4, with a text entry in each
> cell. =A0That you wanted a bunch of your existing sheets named the names i=
n
> this list, one name per sheet. =A0What do you mean by "so that I only have=
to
> alter one cell to get them all to be the same"??
> Perhaps it would be better if you just write down a step-by-step procedure=

> of how you would do this if you were doing it manually. =A0Leave nothing o=
ut!
> Otto
>
> "NickTheBatMan" <nickw7...@gmail.com> wrote in message
>
> news:2321560a-1e8c-4783-8ef6-d02cc56a4709@y21g2000hsf.googlegroups.com...
> On 17 Apr, 14:02, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
> wrote:
>
>
>
>
>
> > Nick
> > What do you mean by "I was hoping that it may work after I had changed
> > the contents of the cell and come out of it...". What cell? In what shee=
t?
> > Do you mean you wanted the code to fire when you changed the entry in so=
me
> > cell? That's easy enough to do.
> > What buttons? Otto
>
> > "NickTheBatMan" <nickw7...@gmail.com> wrote in message
>
> >news:c4bd6aab-7581-4f6f-8b6e-d825359de93c@l64g2000hse.googlegroups.com...=

> > Many thanks Otto, that works - sort of... :)
>
> > I was hoping that it may work after I had changed the contents of the
> > cell and come out of it...
>
> > The problem I now have is that I have Run-time error '1004'
> > That means I have over 31 characters and there are ones that
> > contravene the : \ / * [ ] rule for naming the sheets...
> > I'll have to rethink the wording of the buttons - or just do it
> > manually...
>
> > Nick
>
> > On 16 Apr, 23:36, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
> > wrote:
>
> > > Nick
> > > Make a copy of your file and do all this on the copy until you feel
> > > comfortable with it and it's doing what you want.
> > > With your file on the screen, do Alt-F11. This takes you to the VBE
> > > (Visual Basic Editor). On the left side of the VBE should be a pane
> > > labeled
> > > Project - VBA Project. If it's not there, click on View - Project
> > > Explorer.
> > > Find your file name in the Project Explorer and click on it. Do Insert=
-
> > > Module. This brings up a larger blank pane on the right. Paste the mac=
ro
> > > there. "X" out of the VBE to return to your sheet.
> > > Note that the macro name is RenameExistingSheets.
> > > Click on Tools - Macro - Macros. Find the name of the macro. Click on
> > > it.
> > > Click on Run. See what happens. If you feel shaky doing this, send me
> > > your
> > > file and I'll place the macro for you and maybe give you a button in t=
he
> > > Header sheet that you can click on to run the macro. My email is
> > > moehrbachoex...@bellsouth.net. Remove the "extra" from this address. H=
TH
> > > Otto"NickTheBatMan" <nickw7...@gmail.com> wrote in message
>
> > >news:75e8a73f-01ac-4eaf-85c2-8bc1c959d527@8g2000hsu.googlegroups.com...=

>
> > > > On Apr 16, 8:22 pm, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>=

> > > > wrote:
> > > >> Nick
> > > >> This little macro will rename every sheet in the file by the list y=
ou
> > > >> have. It will not rename the "Headers" or "Links" sheets. HTH Otto
> > > >> Sub RenameExistingSheets()
> > > >> Dim rSheetNames As Range
> > > >> Dim ws As Worksheet
> > > >> Dim c As Long
> > > >> Application.ScreenUpdating =3D False
> > > >> c =3D 1
> > > >> Sheets("Headers").Select
> > > >> Set rSheetNames =3D Range("B1:H4")
> > > >> For Each ws In ActiveWorkbook.Worksheets
> > > >> If ws.Name <> "Headers" And ws.Name <> "Links" Then
> > > >> ws.Name =3D rSheetNames(c).Value
> > > >> c =3D c + 1
> > > >> End If
> > > >> Next ws
> > > >> Application.ScreenUpdating =3D True
> > > >> End Sub
>
> > > > Thanks you Otto, where do I put it ?
>
> > > > Just off to bed at 22:00 for the first of four 05:00 alarms for work=
!
> > > > Shall catch up tomorrow through Google Groups...
> > > > Nick- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -
>
> Hi Otto, sorry about that, getting mixed up between what I'm doing and
> trying to do... if you look back in the thread you'll see that I'm
> doing this instead of doing it in Access !
>
> I have a sheet called Headers that I'm using to enter data into cells
> and using that to refer to in these other sheets so that I only have
> to alter one cell to get them all to be the same - this is the same
> cell that I'm hoping to use to name the different sheets...
>
> I meant cell when I typed button, it's going to end up being a button
> in a form in Access when I've finished... I'm stuck to using Excel to
> prove the layout and procude another list in another sheet of this
> book which I'll be using to update the Access table
> eventually...................................... oh why do I let
> myself in fot this sort of thing ! :) :(- Hide quoted text -
>
> - Show quoted text -

Otto, sorry for the mix up as you say I got it totally wrong in what I
was wanting...

I am hoping that when I alter any of the cells B1-H4 in this Headers
sheet, that it will name the sheets from 3 onwards - the first 2 are
set as Links & Headers. Does that explain it better ?

I think as usual my poor way of putting what I want across is letting
me down and I'll just leave it that I have to remember to change the
sheet names manually...

Nick

Re: How to name a sheet from text in a cell in another sheet ? by Otto

Otto
Fri Apr 18 10:28:08 CDT 2008

Nick
Here are 2 macros that must both be in your file. Between the 2 of
them, they will rename all the sheets (except Headers and Links sheets) to
the names in B1:H4 of the Headers sheet. The trigger that will fire these
macros is a change in the content of any cell in the B1:H4 range.
You have already placed the RenameExistingSheets macro correctly and I
haven't changed it from what I sent you before. But the other macro (the
first macro below) is different in that it MUST be placed in a different
kind of module. That macro is a sheet macro and MUST be placed in the sheet
module of the Headers sheet. You can access that module by right-clicking
on the Headers sheet tab and selecting View Code. Paste that macro into
that module. "X" out of the VBE to return to your sheet. Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If IsEmpty(Target.Value) Then Exit Sub
If Not Intersect(Target, Range("B1:H4")) Is Nothing Then
Call RenameExistingSheets
End If
End Sub

Sub RenameExistingSheets()
Dim rSheetNames As Range
Dim ws As Worksheet
Dim c As Long
Application.ScreenUpdating = False
c = 1
Sheets("Headers").Select
Set rSheetNames = Range("B1:H4")
For Each ws In ActiveWorkbook.Worksheets
If ws.Name <> "Headers" And ws.Name <> "Links" Then
ws.Name = rSheetNames(c).Value
c = c + 1
End If
Next ws
Application.ScreenUpdating = True
End Sub
"NickTheBatMan" <nickw7coc@gmail.com> wrote in message
news:da852f6c-d848-437b-94e0-4cfb38639fa5@f63g2000hsf.googlegroups.com...
On 17 Apr, 21:33, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
wrote:
> Nick
> Up until now I thought I understood what you wanted. But now, I don't
> know. You say:
> "I have a sheet called Headers that I'm using to enter data into cells
> and using that to refer to in these other sheets so that I only have
> to alter one cell to get them all to be the same - this is the same
> cell that I'm hoping to use to name the different sheets...".
> I thought that you had a range of cells, B1:H4, with a text entry in each
> cell. That you wanted a bunch of your existing sheets named the names in
> this list, one name per sheet. What do you mean by "so that I only have to
> alter one cell to get them all to be the same"??
> Perhaps it would be better if you just write down a step-by-step procedure
> of how you would do this if you were doing it manually. Leave nothing out!
> Otto
>
> "NickTheBatMan" <nickw7...@gmail.com> wrote in message
>
> news:2321560a-1e8c-4783-8ef6-d02cc56a4709@y21g2000hsf.googlegroups.com...
> On 17 Apr, 14:02, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
> wrote:
>
>
>
>
>
> > Nick
> > What do you mean by "I was hoping that it may work after I had changed
> > the contents of the cell and come out of it...". What cell? In what
> > sheet?
> > Do you mean you wanted the code to fire when you changed the entry in
> > some
> > cell? That's easy enough to do.
> > What buttons? Otto
>
> > "NickTheBatMan" <nickw7...@gmail.com> wrote in message
>
> >news:c4bd6aab-7581-4f6f-8b6e-d825359de93c@l64g2000hse.googlegroups.com...
> > Many thanks Otto, that works - sort of... :)
>
> > I was hoping that it may work after I had changed the contents of the
> > cell and come out of it...
>
> > The problem I now have is that I have Run-time error '1004'
> > That means I have over 31 characters and there are ones that
> > contravene the : \ / * [ ] rule for naming the sheets...
> > I'll have to rethink the wording of the buttons - or just do it
> > manually...
>
> > Nick
>
> > On 16 Apr, 23:36, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
> > wrote:
>
> > > Nick
> > > Make a copy of your file and do all this on the copy until you feel
> > > comfortable with it and it's doing what you want.
> > > With your file on the screen, do Alt-F11. This takes you to the VBE
> > > (Visual Basic Editor). On the left side of the VBE should be a pane
> > > labeled
> > > Project - VBA Project. If it's not there, click on View - Project
> > > Explorer.
> > > Find your file name in the Project Explorer and click on it. Do
> > > Insert -
> > > Module. This brings up a larger blank pane on the right. Paste the
> > > macro
> > > there. "X" out of the VBE to return to your sheet.
> > > Note that the macro name is RenameExistingSheets.
> > > Click on Tools - Macro - Macros. Find the name of the macro. Click on
> > > it.
> > > Click on Run. See what happens. If you feel shaky doing this, send me
> > > your
> > > file and I'll place the macro for you and maybe give you a button in
> > > the
> > > Header sheet that you can click on to run the macro. My email is
> > > moehrbachoex...@bellsouth.net. Remove the "extra" from this address.
> > > HTH
> > > Otto"NickTheBatMan" <nickw7...@gmail.com> wrote in message
>
> > >news:75e8a73f-01ac-4eaf-85c2-8bc1c959d527@8g2000hsu.googlegroups.com...
>
> > > > On Apr 16, 8:22 pm, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
> > > > wrote:
> > > >> Nick
> > > >> This little macro will rename every sheet in the file by the list
> > > >> you
> > > >> have. It will not rename the "Headers" or "Links" sheets. HTH Otto
> > > >> Sub RenameExistingSheets()
> > > >> Dim rSheetNames As Range
> > > >> Dim ws As Worksheet
> > > >> Dim c As Long
> > > >> Application.ScreenUpdating = False
> > > >> c = 1
> > > >> Sheets("Headers").Select
> > > >> Set rSheetNames = Range("B1:H4")
> > > >> For Each ws In ActiveWorkbook.Worksheets
> > > >> If ws.Name <> "Headers" And ws.Name <> "Links" Then
> > > >> ws.Name = rSheetNames(c).Value
> > > >> c = c + 1
> > > >> End If
> > > >> Next ws
> > > >> Application.ScreenUpdating = True
> > > >> End Sub
>
> > > > Thanks you Otto, where do I put it ?
>
> > > > Just off to bed at 22:00 for the first of four 05:00 alarms for work
> > > > !
> > > > Shall catch up tomorrow through Google Groups...
> > > > Nick- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -
>
> Hi Otto, sorry about that, getting mixed up between what I'm doing and
> trying to do... if you look back in the thread you'll see that I'm
> doing this instead of doing it in Access !
>
> I have a sheet called Headers that I'm using to enter data into cells
> and using that to refer to in these other sheets so that I only have
> to alter one cell to get them all to be the same - this is the same
> cell that I'm hoping to use to name the different sheets...
>
> I meant cell when I typed button, it's going to end up being a button
> in a form in Access when I've finished... I'm stuck to using Excel to
> prove the layout and procude another list in another sheet of this
> book which I'll be using to update the Access table
> eventually...................................... oh why do I let
> myself in fot this sort of thing ! :) :(- Hide quoted text -
>
> - Show quoted text -

Otto, sorry for the mix up as you say I got it totally wrong in what I
was wanting...

I am hoping that when I alter any of the cells B1-H4 in this Headers
sheet, that it will name the sheets from 3 onwards - the first 2 are
set as Links & Headers. Does that explain it better ?

I think as usual my poor way of putting what I want across is letting
me down and I'll just leave it that I have to remember to change the
sheet names manually...

Nick



Re: How to name a sheet from text in a cell in another sheet ? by NickTheBatMan

NickTheBatMan
Sun Apr 20 11:20:04 CDT 2008

On 18 Apr, 16:28, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
wrote:
> Nick
> =A0 =A0 Here are 2 macros that must both be in your file. =A0Between the 2=
of
> them, they will rename all the sheets (except Headers and Links sheets) to=

> the names in B1:H4 of the Headers sheet. =A0The trigger that will fire the=
se
> macros is a change in the content of any cell in the B1:H4 range.
> You have already placed the RenameExistingSheets macro correctly and I
> haven't changed it from what I sent you before. =A0But the other macro (th=
e
> first macro below) is different in that it MUST be placed in a different
> kind of module. =A0That macro is a sheet macro and MUST be placed in the s=
heet
> module of the Headers sheet. =A0You can access that module by right-clicki=
ng
> on the Headers sheet tab and selecting View Code. =A0Paste that macro into=

> that module. =A0"X" out of the VBE to return to your sheet. =A0Otto
> Private Sub Worksheet_Change(ByVal Target As Range)
> =A0 =A0 =A0 If Target.Count > 1 Then Exit Sub
> =A0 =A0 =A0 If IsEmpty(Target.Value) Then Exit Sub
> =A0 =A0 =A0 If Not Intersect(Target, Range("B1:H4")) Is Nothing Then
> =A0 =A0 =A0 =A0 =A0 =A0 Call RenameExistingSheets
> =A0 =A0 =A0 End If
> End Sub
>
> Sub RenameExistingSheets()
> =A0 =A0 =A0 Dim rSheetNames As Range
> =A0 =A0 =A0 Dim ws As Worksheet
> =A0 =A0 =A0 Dim c As Long
> =A0 =A0 =A0 Application.ScreenUpdating =3D False
> =A0 =A0 =A0 c =3D 1
> =A0 =A0 =A0 Sheets("Headers").Select
> =A0 =A0 =A0 Set rSheetNames =3D Range("B1:H4")
> =A0 =A0 =A0 For Each ws In ActiveWorkbook.Worksheets
> =A0 =A0 =A0 =A0 =A0 =A0 If ws.Name <> "Headers" And ws.Name <> "Links" The=
n
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ws.Name =3D rSheetNames(c).Value
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 c =3D c + 1
> =A0 =A0 =A0 =A0 =A0 =A0 End If
> =A0 =A0 =A0 Next ws
> =A0 =A0 =A0 Application.ScreenUpdating =3D True
> End Sub"NickTheBatMan" <nickw7...@gmail.com> wrote in message
>
> news:da852f6c-d848-437b-94e0-4cfb38639fa5@f63g2000hsf.googlegroups.com...
> On 17 Apr, 21:33, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
> wrote:
>
>
>
>
>
> > Nick
> > Up until now I thought I understood what you wanted. But now, I don't
> > know. You say:
> > "I have a sheet called Headers that I'm using to enter data into cells
> > and using that to refer to in these other sheets so that I only have
> > to alter one cell to get them all to be the same - this is the same
> > cell that I'm hoping to use to name the different sheets...".
> > I thought that you had a range of cells, B1:H4, with a text entry in eac=
h
> > cell. That you wanted a bunch of your existing sheets named the names in=

> > this list, one name per sheet. What do you mean by "so that I only have =
to
> > alter one cell to get them all to be the same"??
> > Perhaps it would be better if you just write down a step-by-step procedu=
re
> > of how you would do this if you were doing it manually. Leave nothing ou=
t!
> > Otto
>
> > "NickTheBatMan" <nickw7...@gmail.com> wrote in message
>
> >news:2321560a-1e8c-4783-8ef6-d02cc56a4709@y21g2000hsf.googlegroups.com...=

> > On 17 Apr, 14:02, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
> > wrote:
>
> > > Nick
> > > What do you mean by "I was hoping that it may work after I had changed=

> > > the contents of the cell and come out of it...". What cell? In what
> > > sheet?
> > > Do you mean you wanted the code to fire when you changed the entry in
> > > some
> > > cell? That's easy enough to do.
> > > What buttons? Otto
>
> > > "NickTheBatMan" <nickw7...@gmail.com> wrote in message
>
> > >news:c4bd6aab-7581-4f6f-8b6e-d825359de93c@l64g2000hse.googlegroups.com.=
..
> > > Many thanks Otto, that works - sort of... :)
>
> > > I was hoping that it may work after I had changed the contents of the
> > > cell and come out of it...
>
> > > The problem I now have is that I have Run-time error '1004'
> > > That means I have over 31 characters and there are ones that
> > > contravene the : \ / * [ ] rule for naming the sheets...
> > > I'll have to rethink the wording of the buttons - or just do it
> > > manually...
>
> > > Nick
>
> > > On 16 Apr, 23:36, "Otto Moehrbach" <moehrbachoex...@bellsouth.net>
> > > wrote:
>
> > > > Nick
> > > > Make a copy of your file and do all this on the copy until you feel
> > > > comfortable with it and it's doing what you want.
> > > > With your file on the screen, do Alt-F11. This takes you to the VBE
> > > > (Visual Basic Editor). On the left side of the VBE should be a pane
> > > > labeled
> > > > Project - VBA Project. If it's not there, click on View - Project
> > > > Explorer.
> > > > Find your file name in the Project Explorer and click on it. Do
> > > > Insert -
> > > > Module. This brings up a larger blank pane on the right. Paste the
> > > > macro
> > > > there. "X" out of the VBE to return to your sheet.
> > > > Note that the macro name is RenameExistingSheets.
> > > > Click on Tools - Macro - Macros. Find the name of the macro. Click o=
n
> > > > it.
> > > > Click on Run. See what happens. If you feel shaky doing this, send m=
e
> > > > your
> > > > file and I'll place the macro for you and maybe give you a button in=

> > > > the
> > > > Header sheet that you can click on to run the macro. My email is
> > > > moehrbachoex...@bellsouth.net. Remove the "extra" from this address.=

> > > > HTH
> > > > Otto"NickTheBatMan" <nickw7...@gmail.com> wrote in message
>
> > > >news:75e8a73f-01ac-4eaf-85c2-8bc1c959d527@8g2000hsu.googlegroups.com.=
..
>
> > > > > On Apr 16, 8:22 pm, "Otto Moehrbach" <moehrbachoex...@bellsouth.ne=
t>
> > > > > wrote:
> > > > >> Nick
> > > > >> This little macro will rename every sheet in the file by the list=

> > > > >> you
> > > > >> have. It will not rename the "Headers" or "Links" sheets. HTH Ott=
o
> > > > >> Sub RenameExistingSheets()
> > > > >> Dim rSheetNames As Range
> > > > >> Dim ws As Worksheet
> > > > >> Dim c As Long
> > > > >> Application.ScreenUpdating =3D False
> > > > >> c =3D 1
> > > > >> Sheets("Headers").Select
> > > > >> Set rSheetNames =3D Range("B1:H4")
> > > > >> For Each ws In ActiveWorkbook.Worksheets
> > > > >> If ws.Name <> "Headers" And ws.Name <> "Links" Then
> > > > >> ws.Name =3D rSheetNames(c).Value
> > > > >> c =3D c + 1
> > > > >> End If
> > > > >> Next ws
> > > > >> Application.ScreenUpdating =3D True
> > > > >> End Sub
>
> > > > > Thanks you Otto, where do I put it ?
>
> > > > > Just off to bed at 22:00 for the first of four 05:00 alarms for wo=
rk
> > > > > !
> > > > > Shall catch up tomorrow through Google Groups...
> > > > > Nick- Hide quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -
>
> > Hi Otto, sorry about that, getting mixed up between what I'm doing and
> > trying to do... if you look back in the thread you'll see that I'm
> > doing this instead of doing it in Access !
>
> > I have a sheet called Headers that I'm using to enter data into cells
> > and using that to refer to in these other sheets so that I only have
> > to alter one cell to get them all to be the same - this is the same
> > cell that I'm hoping to use to name the different sheets...
>
> > I meant cell when I typed button, it's going to end up being a button
> > in a form in Access when I've finished... I'm stuck to using Excel to
> > prove the layout and procude another list in another sheet of this
> > book which I'll be using to update the Access table
> > eventually...................................... oh why do I let
> > myself in fot this sort of thing ! :) :(- Hide quoted text -
>
> > - Show quoted text -
>
> Otto, sorry for the mix up as you say I got it totally wrong in what I
> was wanting...
>
> I am hoping that when I alter any of the cells B1-H4 in this Headers
> sheet, that it will name the sheets from 3 onwards - the first 2 are
> set as Links & Headers. Does that explain it better ?
>
> I think as usual my poor way of putting what I want across is letting
> me down and I'll just leave it that I have to remember to change the
> sheet names manually...
>
> Nick- Hide quoted text -
>
> - Show quoted text -

Otto, thank you.
I've been very busy today and only just got chance to have a go...

I've followed your instructions and the about which I've added into
the Module of the Headers sheet is returning a Runtime Error 1004
All I've typed in is National Lines

When I debug it highlights this
ws.Name =3D rSheetNames(c).Value

I wish I knew what I was doing so that I didn't have to trouble you !
Many thanks again... :)
Nick

Re: How to name a sheet from text in a cell in another sheet ? by Otto

Otto
Sun Apr 20 16:08:34 CDT 2008

Nick
There is a problem with the code I wrote for you. If none of your
sheets are named any of the sheet names in B1:H4, and you type in a sheet
name in that range, the code will work fine. Otherwise you will get an
error because the code is trying to name a sheet a name that already exists
with another sheet, so I have to do some rewrite of the code.
Tell me this about how you use this file. If the entries in B1:H4 are to be
sheet names, is it that you change one of the names in B1:H4? Is that what
you do? If so then do you want just the one name that you replaced changed
in the sheet that had the old name?
I will add an error trap in the code to pick up on the fact that a name in
B1:H4 is already assigned to on