Change date format

  • Thread starter Thread starter Warren
  • Start date Start date
W

Warren

Can someone please help?

The macro I am writing reads in a date from Cell A1, which is formatted as
dd/mm/yy. I want to create a new sheet with this date as the name. I know
that the sheet name cannot have "/" in it. The sheet is protected and I
cannot unprotect it.

So what is the code to read in this date and convert it to a text string in
the format of dd-mm-yy?

Thanks in advance

Warren
 
Can someone please help?

The macro I am writing reads in a date from Cell A1, which is formatted as
dd/mm/yy. I want to create a new sheet with this date as the name. I know
that the sheet name cannot have "/" in it. The sheet is protected and I
cannot unprotect it.

So what is the code to read in this date and convert it to a text string in
the format of dd-mm-yy?

Format(Activesheet.Range("A1"), "DD-MM-YY")
 
sName = format(Range("a1").Value,"dd-mm-yy")
worksheets.Add
Activesheet.Name = sName
 
Back
Top