View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
al al is offline
external usenet poster
 
Posts: 64
Default Rename sheet with (2) after existing name of existing sheet

Sub SheetNameActivecell()

Application.ActiveSheet.Name = Left(Application.Substitute
(ActiveCell.Value, "/", ""), 31)

End Sub

Would also like to improve macro by adding codes which would allow to
name a sheet with (2) at end of an existing sheet name.
e.g if "Google" already exist - macro would rename sheet as "Google
(2)"

Thxs