Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Renaming worksheets

I thought I had this working but apparently not. I have 100+ worksheets in
my workbook, I need a macro which when run will rename each worksheet to the
worksheets cell AB1 (each worksheet will have its own cell AB1 which will
contain the text to be used as the worksheets name) and when it is done it
must return me to the worksheet which was active when called the macro.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Renaming worksheets

Dim WS as Worksheet
for each WS in Worksheets
WS.name = WS.Range("AB1"=.value
next WS


HTH
--
AP

"Patrick Simonds" a écrit dans le message de
...
I thought I had this working but apparently not. I have 100+ worksheets

in
my workbook, I need a macro which when run will rename each worksheet to

the
worksheets cell AB1 (each worksheet will have its own cell AB1 which will
contain the text to be used as the worksheets name) and when it is done it
must return me to the worksheet which was active when called the macro.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Renaming worksheets

Hi Patrick,

Try:

'=============
Public Sub Tester001()
Dim SH As Worksheet

For Each SH In ActiveWorkbook.Worksheets
SH.Name = SH.Range("AB1").Value
Next SH

End Sub
'<<=============

Since no selecrions are made, the active sheet does not change,


---
Regards,
Norman



"Patrick Simonds" wrote in message
...
I thought I had this working but apparently not. I have 100+ worksheets in
my workbook, I need a macro which when run will rename each worksheet to
the worksheets cell AB1 (each worksheet will have its own cell AB1 which
will contain the text to be used as the worksheets name) and when it is
done it must return me to the worksheet which was active when called the
macro.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Renaming worksheets

Typo alert.

Dim WS as Worksheet
for each WS in Worksheets
WS.name = WS.Range("AB1").value
next WS

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Ardus Petus" wrote in message
...
Dim WS as Worksheet
for each WS in Worksheets
WS.name = WS.Range("AB1"=.value
next WS


HTH
--
AP

"Patrick Simonds" a écrit dans le message de
...
I thought I had this working but apparently not. I have 100+ worksheets

in
my workbook, I need a macro which when run will rename each worksheet to

the
worksheets cell AB1 (each worksheet will have its own cell AB1 which

will
contain the text to be used as the worksheets name) and when it is done

it
must return me to the worksheet which was active when called the macro.






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Renaming worksheets

Thanks!

--
AP

"Bob Phillips" a écrit dans le message
de ...
Typo alert.

Dim WS as Worksheet
for each WS in Worksheets
WS.name = WS.Range("AB1").value
next WS

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Ardus Petus" wrote in message
...
Dim WS as Worksheet
for each WS in Worksheets
WS.name = WS.Range("AB1"=.value
next WS


HTH
--
AP

"Patrick Simonds" a écrit dans le message de
...
I thought I had this working but apparently not. I have 100+

worksheets
in
my workbook, I need a macro which when run will rename each worksheet

to
the
worksheets cell AB1 (each worksheet will have its own cell AB1 which

will
contain the text to be used as the worksheets name) and when it is

done
it
must return me to the worksheet which was active when called the

macro.










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Renaming worksheets

This does not seem to work. It runs through all the sheets but does not
rename them. This is what is found in cell AB1:

=TEXT($A$4,"dd mmm yy")

I did not referance cell A4 directly because it contained a formula to
arrive at the date.


"Bob Phillips" wrote in message
...
Typo alert.

Dim WS as Worksheet
for each WS in Worksheets
WS.name = WS.Range("AB1").value
next WS

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Ardus Petus" wrote in message
...
Dim WS as Worksheet
for each WS in Worksheets
WS.name = WS.Range("AB1"=.value
next WS


HTH
--
AP

"Patrick Simonds" a écrit dans le message de
...
I thought I had this working but apparently not. I have 100+
worksheets

in
my workbook, I need a macro which when run will rename each worksheet
to

the
worksheets cell AB1 (each worksheet will have its own cell AB1 which

will
contain the text to be used as the worksheets name) and when it is done

it
must return me to the worksheet which was active when called the
macro.








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
RENAMING WORKSHEETS LEOPARDSHIDEAWAY Excel Worksheet Functions 1 July 26th 07 10:27 PM
Renaming worksheets Mike Allen Excel Discussion (Misc queries) 8 January 21st 07 02:15 AM
Renaming worksheets Greg B[_5_] Excel Programming 2 May 17th 05 05:56 PM
Renaming Worksheets Steve Walford Excel Worksheet Functions 3 April 1st 05 09:29 PM
Renaming Worksheets rbanks[_10_] Excel Programming 2 June 16th 04 11:51 PM


All times are GMT +1. The time now is 05:18 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"