ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Finding and Replacing Sheet Names (https://www.excelbanter.com/excel-programming/445889-finding-replacing-sheet-names.html)

Akash

Finding and Replacing Sheet Names
 
Hello to everybody, (and Happy Thanksgiving!)

A workbook has multiple sheets like

GGN - Apr'12,
GGN - May-12,
GGN - Jun-12,
GGN - Jul-12,
GGN - Aug-12

and it continue till GGN - Mar-13.


I would like to change all the GGN to DDN

How??

Thanks

Rgds

Akash Maheshwari

GS[_2_]

Finding and Replacing Sheet Names
 
Try...

Sub RenameSheets()
Dim wks As Worksheet
For Each wks In ActiveWorkbook.Worksheets
wks.Name = Replace(wks.Name, "GGN", "DDN", , 1)
Next 'wks
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion




All times are GMT +1. The time now is 10:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com