Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Change date format

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Change date format

On Fri, 06 Feb 2004 04:01:20 GMT, "Warren" wrote:

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")


---------------------------------------------------------
Hank Scorpio
scorpionet who hates spam is at iprimus.com.au (You know what to do.)
* Please keep all replies in this Newsgroup. Thanks! *
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Change date format

sName = format(Range("a1").Value,"dd-mm-yy")
worksheets.Add
Activesheet.Name = sName

--
Regards,
Tom Ogilvy

Warren wrote in message
news:kkEUb.185726$5V2.902591@attbi_s53...
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
change date format dd/mm/yyyy to Julian date format? itzy bitzy Excel Worksheet Functions 1 December 8th 09 07:42 PM
Change Date Format to Specific Text Format When Copying [email protected] Excel Discussion (Misc queries) 4 December 23rd 08 03:43 PM
Use date modified to change format & create filter to track change PAR Excel Worksheet Functions 0 November 15th 06 09:17 PM
Can I change a date with no format (20051111) to date format? Rose New Users to Excel 2 November 11th 05 09:03 PM
Change a date in text format xx.xx.20xx to a recognised date format concatenator Excel Programming 1 November 24th 03 11:33 PM


All times are GMT +1. The time now is 07:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"