Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Rename Multiple work sheet
I have around 10 worksheets .....5 contains the word "[Trend]" in their
sheet name for example "Product1 [Trend]" I want a Macro that can search for word "[Trend]" in available worksheets and delete this word or replace it with some other text..so that worksheet rename as "Product1". Is it possible...? Thank you, Murtaza |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Rename Multiple work sheet
Murtaza,
I don't know how you can have square brackets in your sheet names, but this code will loop through the sheets and remove "Trend" from the sheet names. Sub test() Dim sht As Worksheet For Each sht In ThisWorkbook.Worksheets sht.Name = Trim(Replace(sht.Name, "Trend", "", 1, -1, vbTextCompare)) Next sht End Sub -- Hope that helps. Vergel Adriano "Murtaza" wrote: I have around 10 worksheets .....5 contains the word "[Trend]" in their sheet name for example "Product1 [Trend]" I want a Macro that can search for word "[Trend]" in available worksheets and delete this word or replace it with some other text..so that worksheet rename as "Product1". Is it possible...? Thank you, Murtaza |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Rename Multiple work sheet
Dear Adriano: (what does this name means)
Its not that difficult....you can safely type "anytext [Trend]" as a sheet name and Excel will accept....but I am suffering this [] when linking the cells in diffrent workbook. Therefore I want to remove this sq bracket. Thanks for your simple/short code....I hope it will help. "Vergel Adriano" wrote in message ... Murtaza, I don't know how you can have square brackets in your sheet names, but this code will loop through the sheets and remove "Trend" from the sheet names. Sub test() Dim sht As Worksheet For Each sht In ThisWorkbook.Worksheets sht.Name = Trim(Replace(sht.Name, "Trend", "", 1, -1, vbTextCompare)) Next sht End Sub -- Hope that helps. Vergel Adriano "Murtaza" wrote: I have around 10 worksheets .....5 contains the word "[Trend]" in their sheet name for example "Product1 [Trend]" I want a Macro that can search for word "[Trend]" in available worksheets and delete this word or replace it with some other text..so that worksheet rename as "Product1". Is it possible...? Thank you, Murtaza |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do i rename a sheet if the rename tab is inactive? | Excel Worksheet Functions | |||
multiple work sheet data to link in one worksheet | Excel Worksheet Functions | |||
need a function that will work using multiple work books and sheet | Excel Worksheet Functions | |||
Multiple work sheet merge | Excel Discussion (Misc queries) | |||
Move data to new sheet - rename sheet based on criteria ? | Excel Discussion (Misc queries) |