View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Rename active sheet

Try this

ActiveSheet.Name = Format(Range("A1"), "mm-dd-yy")


--
Regards Ron de Bruin
http://www.rondebruin.nl


"lumaduc " wrote in message ...
I am trying to rename the active sheet from a cell in the sheet. The
cell has a date. The cell has a date format of mm-dd-yy which is how I
want the sheet to be renamed. When using Selection.Copy the date
format is mm/dd/yy. So when i attempt to rename the sheet it cannot be
renamed since the date format has special characters.

Selection.Copy
ActiveSheet.Select
'ActiveSheet.Name = "01-05-04"
ActiveSheet.Name = Selection

ActiveSheet.Name = "01-05-04" is the correct format but cannot be used
since it will be in a Loop. Using Selection formats the date as
mm/dd/yy.

Is there a way to format Selection as mm-dd-yy?


---
Message posted from http://www.ExcelForum.com/