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
On 17 Apr, 14:02, "Otto Moehrbach" <
[email protected]>
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
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" <
[email protected]>
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
(e-mail address removed). Remove the "extra" from this address.
HTH
On Apr 16, 8:22 pm, "Otto Moehrbach"
<
[email protected]>
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 -