LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Name sheets from a list

Thanks Tom...the code works great. My next problem: I have quite a few tabs
to rename. I got to my limit I think. It won't work for sheets past a
certain number of code lines. My question is: Is there a limit to the number
of iterations? If so, how do I get around this? Thanks again!

"Tom Ogilvy" wrote:

You would need to use the change event in Home and use the code name for the
sheet to be renamed.

Right click on the Home sheet Tab and select view code, then in the
resulting module, at the left top dropdown, select worksheet and in the right
top dropdown select Change (not selectionchange). It will put code like this
in the module

Private Sub Worksheet_Change(ByVal Target As Range)

End Sub

This will fire whenever any cell is edited. You can add code to react to
entries in certain cells

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.count 1 then exit sub
If Target.Value = "" then exit sub
if not intersect(Target,range("E9:E24")) is nothing then
if Target.Address = "$E$9" then
Sheet3.Name = Target.Value
Sheet3.Range("C6") = Target.Value
end if
' add code for other cells
End if
End Sub

sheet3 isn't the tab name of the sheet. If you go into the VBE in the
project explorer you will see each sheet has two names. One is the tab name,
the other is the sheet name.

for example if I had a sheet with a tab name of Dog, in the project explorer
it might be listed as

Sheet2 (Dog)

the Sheet2 is the codename.

--
Regards,
Tom Ogilvy




"deeds" wrote:

I have seen several close solutions...here is what I am trying to do:

Sheet "HOME" has a range from e9:e24 When user enters in cell e9 that entry
is linked to cell c6 on another sheet. I want that sheet to be renamed to
that entry. I used anothers code to have it work, however, I need to edit
cell c6, then hit enter and it will change. I need to have it automatically
change the sheet name. I.E. User is on sheet "HOME", they enter in cell E9
and they see the associated sheet name change. Thanks in advance!

 
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
Getting 1 list from 2 sheets txheart Excel Discussion (Misc queries) 3 July 6th 11 05:24 PM
List Sheets excluding sheets named ***-A Dolphinv4 Excel Discussion (Misc queries) 1 December 15th 07 09:29 AM
list of sheets svko Excel Worksheet Functions 1 July 13th 06 10:18 AM
How to get a sheets name or list. Simon Chang Excel Programming 3 November 6th 05 11:48 PM
List of Sheets Dnk Excel Programming 0 April 1st 04 02:59 PM


All times are GMT +1. The time now is 07:02 PM.

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"