Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Rename Many Worksheets at a time.

Dear All,

Can anyone help me? I have a workbook & have more than 400 worksheets in
that file. I want to rename all worksheets at a time i.e. 001 to 400 and so
on. Is there any way to solve my problem? I tried to search but couldn't find
specifically.

Thank you in advance.
--
Shahzad Zameer
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Rename Many Worksheets at a time.

First make sure none of the old names are the same as the new names (we can't
have two sheets with the same name) The enter and run:

Sub sheetorg()
n = 1
For Each w In Worksheets
w.Name = Format(n, "000")
n = n + 1
Next
End Sub


If you not familiar with macros, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm
--
Gary's Student


"Shahzad Zameer" wrote:

Dear All,

Can anyone help me? I have a workbook & have more than 400 worksheets in
that file. I want to rename all worksheets at a time i.e. 001 to 400 and so
on. Is there any way to solve my problem? I tried to search but couldn't find
specifically.

Thank you in advance.
--
Shahzad Zameer

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Rename Many Worksheets at a time.

Hi,

this is quick and dirty but seems to work:

Sub change_Sheet_Name()
Dim i As Integer
For i = 1 To 400
Sheets(i).Name = i
Next

End Sub

Hope this helps

Shahzad Zameer wrote:
Dear All,

Can anyone help me? I have a workbook & have more than 400 worksheets in
that file. I want to rename all worksheets at a time i.e. 001 to 400 and so
on. Is there any way to solve my problem? I tried to search but couldn't find
specifically.

Thank you in advance.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,726
Default Rename Many Worksheets at a time.


"Gary''s Student" wrote in message
...
First make sure none of the old names are the same as the new names (we
can't
have two sheets with the same name)


You could manage it

Sub sheetorg()
Dim n As Long
Dim dw As String
Dim sh As Worksheet
Dim w As Worksheet
n = 1
For Each w In Worksheets
Do
dw = Format(n, "000")
Set sh = Nothing
On Error Resume Next
Set sh = Worksheets(dw)
On Error GoTo 0
If sh Is Nothing Then w.Name = dw
n = n + 1
Loop Until sh Is Nothing
Next
End Sub


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Rename Many Worksheets at a time.

Thank you very much Gary's Student, it solved my problem.
--
Shahzad Zameer


"Gary''s Student" wrote:

First make sure none of the old names are the same as the new names (we can't
have two sheets with the same name) The enter and run:

Sub sheetorg()
n = 1
For Each w In Worksheets
w.Name = Format(n, "000")
n = n + 1
Next
End Sub


If you not familiar with macros, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm
--
Gary's Student


"Shahzad Zameer" wrote:

Dear All,

Can anyone help me? I have a workbook & have more than 400 worksheets in
that file. I want to rename all worksheets at a time i.e. 001 to 400 and so
on. Is there any way to solve my problem? I tried to search but couldn't find
specifically.

Thank you in advance.
--
Shahzad Zameer



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Rename Many Worksheets at a time.

Dear "Gary''s Student"

Thank you for your help regarding the Renaming the Many Worksheets at a
time. Please can you do more favor that if I want to put name of the sheets
like this SACL0001, SACL0002 or ABCD001, ABCD0002 and so on then how to put
this formula. I tried to put w.Name = Format(n, "SACL000") instead of w.Name
= Format(n, "000") but its not working. When I put w.Name = Format(n,
"AB000") its working fine but more than two letters its not working. Please
help me in this regards too.

Thank you in advance.

Best Regards

--
Shahzad Zameer


"Gary''s Student" wrote:

First make sure none of the old names are the same as the new names (we can't
have two sheets with the same name) The enter and run:

Sub sheetorg()
n = 1
For Each w In Worksheets
w.Name = Format(n, "000")
n = n + 1
Next
End Sub


If you not familiar with macros, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm
--
Gary's Student


"Shahzad Zameer" wrote:

Dear All,

Can anyone help me? I have a workbook & have more than 400 worksheets in
that file. I want to rename all worksheets at a time i.e. 001 to 400 and so
on. Is there any way to solve my problem? I tried to search but couldn't find
specifically.

Thank you in advance.
--
Shahzad Zameer

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Rename Many Worksheets at a time.

Dear Bob Phillips

Thank you for your help regarding the Renaming the Many Worksheets at a
time. Please can you do more favor that if I want to put name of the sheets
like this SACL0001, SACL0002 or ABCD001, ABCD0002 and so on then how to put
this formula. I tried to put w.Name = Format(n, "SACL000") instead of w.Name
= Format(n, "000") but its not working. When I put w.Name = Format(n,
"AB000") its working fine but more than two letters its not working. Please
help me in this regards too.

Thank you in advance.

Best Regards
--
Shahzad Zameer


"Bob Phillips" wrote:


"Gary''s Student" wrote in message
...
First make sure none of the old names are the same as the new names (we
can't
have two sheets with the same name)


You could manage it

Sub sheetorg()
Dim n As Long
Dim dw As String
Dim sh As Worksheet
Dim w As Worksheet
n = 1
For Each w In Worksheets
Do
dw = Format(n, "000")
Set sh = Nothing
On Error Resume Next
Set sh = Worksheets(dw)
On Error GoTo 0
If sh Is Nothing Then w.Name = dw
n = n + 1
Loop Until sh Is Nothing
Next
End Sub



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Rename Many Worksheets at a time.

Actually you were very close to getting the corrrect answer yourself:

Sub sheetorg()
n = 1
For Each w In Worksheets
w.Name = "SACL" & Format(n, "000")
n = n + 1
Next
End Sub
--
Gary's Student


"Shahzad Zameer" wrote:

Dear "Gary''s Student"

Thank you for your help regarding the Renaming the Many Worksheets at a
time. Please can you do more favor that if I want to put name of the sheets
like this SACL0001, SACL0002 or ABCD001, ABCD0002 and so on then how to put
this formula. I tried to put w.Name = Format(n, "SACL000") instead of w.Name
= Format(n, "000") but its not working. When I put w.Name = Format(n,
"AB000") its working fine but more than two letters its not working. Please
help me in this regards too.

Thank you in advance.

Best Regards

--
Shahzad Zameer


"Gary''s Student" wrote:

First make sure none of the old names are the same as the new names (we can't
have two sheets with the same name) The enter and run:

Sub sheetorg()
n = 1
For Each w In Worksheets
w.Name = Format(n, "000")
n = n + 1
Next
End Sub


If you not familiar with macros, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm
--
Gary's Student


"Shahzad Zameer" wrote:

Dear All,

Can anyone help me? I have a workbook & have more than 400 worksheets in
that file. I want to rename all worksheets at a time i.e. 001 to 400 and so
on. Is there any way to solve my problem? I tried to search but couldn't find
specifically.

Thank you in advance.
--
Shahzad Zameer

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Rename Many Worksheets at a time.

Thank you so much for instant help. May God bless you.

Regards
--
Shahzad Zameer


"Gary''s Student" wrote:

Actually you were very close to getting the corrrect answer yourself:

Sub sheetorg()
n = 1
For Each w In Worksheets
w.Name = "SACL" & Format(n, "000")
n = n + 1
Next
End Sub
--
Gary's Student


"Shahzad Zameer" wrote:

Dear "Gary''s Student"

Thank you for your help regarding the Renaming the Many Worksheets at a
time. Please can you do more favor that if I want to put name of the sheets
like this SACL0001, SACL0002 or ABCD001, ABCD0002 and so on then how to put
this formula. I tried to put w.Name = Format(n, "SACL000") instead of w.Name
= Format(n, "000") but its not working. When I put w.Name = Format(n,
"AB000") its working fine but more than two letters its not working. Please
help me in this regards too.

Thank you in advance.

Best Regards

--
Shahzad Zameer


"Gary''s Student" wrote:

First make sure none of the old names are the same as the new names (we can't
have two sheets with the same name) The enter and run:

Sub sheetorg()
n = 1
For Each w In Worksheets
w.Name = Format(n, "000")
n = n + 1
Next
End Sub


If you not familiar with macros, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm
--
Gary's Student


"Shahzad Zameer" wrote:

Dear All,

Can anyone help me? I have a workbook & have more than 400 worksheets in
that file. I want to rename all worksheets at a time i.e. 001 to 400 and so
on. Is there any way to solve my problem? I tried to search but couldn't find
specifically.

Thank you in advance.
--
Shahzad Zameer

  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Rename Many Worksheets at a time.

And you as well.
--
Gary's Student


"Shahzad Zameer" wrote:

Thank you so much for instant help. May God bless you.

Regards
--
Shahzad Zameer


"Gary''s Student" wrote:

Actually you were very close to getting the corrrect answer yourself:

Sub sheetorg()
n = 1
For Each w In Worksheets
w.Name = "SACL" & Format(n, "000")
n = n + 1
Next
End Sub
--
Gary's Student


"Shahzad Zameer" wrote:

Dear "Gary''s Student"

Thank you for your help regarding the Renaming the Many Worksheets at a
time. Please can you do more favor that if I want to put name of the sheets
like this SACL0001, SACL0002 or ABCD001, ABCD0002 and so on then how to put
this formula. I tried to put w.Name = Format(n, "SACL000") instead of w.Name
= Format(n, "000") but its not working. When I put w.Name = Format(n,
"AB000") its working fine but more than two letters its not working. Please
help me in this regards too.

Thank you in advance.

Best Regards

--
Shahzad Zameer


"Gary''s Student" wrote:

First make sure none of the old names are the same as the new names (we can't
have two sheets with the same name) The enter and run:

Sub sheetorg()
n = 1
For Each w In Worksheets
w.Name = Format(n, "000")
n = n + 1
Next
End Sub


If you not familiar with macros, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm
--
Gary's Student


"Shahzad Zameer" wrote:

Dear All,

Can anyone help me? I have a workbook & have more than 400 worksheets in
that file. I want to rename all worksheets at a time i.e. 001 to 400 and so
on. Is there any way to solve my problem? I tried to search but couldn't find
specifically.

Thank you in advance.
--
Shahzad Zameer

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
Copying Worksheets with Validations - Response Time Kevin L. Excel Discussion (Misc queries) 0 December 18th 06 04:36 PM
Is it possible to protect multiple worksheets at the same time Terrie Excel Worksheet Functions 1 October 18th 06 08:06 PM
Excel Time Manipulation BFiedler Excel Discussion (Misc queries) 0 September 15th 05 01:15 AM
how can I get all worksheets to print at one time? Sofia Excel Worksheet Functions 2 April 19th 05 07:13 PM
Create a custom footer for all Excel worksheets at one time... bigcat Excel Discussion (Misc queries) 2 March 31st 05 12:15 AM


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