Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default Find and Replace Sheet names

Any idea/code for changing the names of worksheets' names in a single go!
For instance,
Converting sheet names like the following:

Sheet(1)
Sheet(2)
Sheet(3)
Sheet(4)
Sheet(5) ...

as follows:

Sheet-1
Sheet-2
Sheet-3
Sheet-4
Sheet-5 ...

Thanx in advance
--

Best Regards,
FARAZ A. QURESHI
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,805
Default Find and Replace Sheet names

Use the macro
Sub rename_Sheets()
i = 1
For Each ws In Worksheets
ws.Name = "Sheet-" & i
i = i + 1
Next
End Sub

"FARAZ QURESHI" wrote:

Any idea/code for changing the names of worksheets' names in a single go!
For instance,
Converting sheet names like the following:

Sheet(1)
Sheet(2)
Sheet(3)
Sheet(4)
Sheet(5) ...

as follows:

Sheet-1
Sheet-2
Sheet-3
Sheet-4
Sheet-5 ...

Thanx in advance
--

Best Regards,
FARAZ A. QURESHI

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,346
Default Find and Replace Sheet names

Hi,

Here is another alternative which assumes that the sheets may not all be
number in order and that some of the sheets may not need to be renamed
because they aren't numbered in the said manner:

Sub Rename()
Dim ws As Worksheet
On Error Resume Next
For Each ws In Worksheets
ws.Name = Replace(Replace(ws.Name, "(", "-"), ")", "")
Next ws
End Sub
--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"FARAZ QURESHI" wrote:

Any idea/code for changing the names of worksheets' names in a single go!
For instance,
Converting sheet names like the following:

Sheet(1)
Sheet(2)
Sheet(3)
Sheet(4)
Sheet(5) ...

as follows:

Sheet-1
Sheet-2
Sheet-3
Sheet-4
Sheet-5 ...

Thanx in advance
--

Best Regards,
FARAZ A. QURESHI

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
How to find and Replace hyperlink in hold sheet? Wiparat Excel Discussion (Misc queries) 1 August 5th 07 11:40 AM
How do I replace A, B, C, Column names, with my own names? Lugojanul Excel Discussion (Misc queries) 1 March 15th 07 07:46 PM
How to find/replace all of the names of files in EXCEL workbook. Peter Multach Excel Discussion (Misc queries) 2 March 5th 07 02:52 PM
find and replace - replace data in rows to separated by commas msdker Excel Worksheet Functions 1 April 15th 06 01:00 AM
Find and REPLACE within a selection, or column- not entire sheet/. smithers2002 Excel Worksheet Functions 4 April 21st 05 04:45 PM


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