Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Re Name a Worksheet as a Date Format

Using a Macron how can you rename a Worksheet using a Date format. I have a
Macro that re-names a new Worksheet with whatever Date is in a certain cell,
however the worksheet re-names not in Date format but in numeric format.

Anyone suggest the code that I should insert? My current code is as below

strSheetName = Worksheets(ActiveSheet.Name).Range("a8")

Where A8 is the document date

Thanks

John


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Re Name a Worksheet as a Date Format

Hi John

Use the Format function

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

ActiveSheet.Name = Format(Now, "dd-mm-yy h-mm-ss")


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"John D O'Connor" wrote in message ...
Using a Macron how can you rename a Worksheet using a Date format. I have a
Macro that re-names a new Worksheet with whatever Date is in a certain cell,
however the worksheet re-names not in Date format but in numeric format.

Anyone suggest the code that I should insert? My current code is as below

strSheetName = Worksheets(ActiveSheet.Name).Range("a8")

Where A8 is the document date

Thanks

John




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Re Name a Worksheet as a Date Format

Hi John
try
strSheetName =
Format(Worksheets(ActiveSheet.Name).Range("a8"),"m mddyyyy")
apply the format code to your needs

--
Regards
Frank Kabel
Frankfurt, Germany

John D O'Connor wrote:
Using a Macron how can you rename a Worksheet using a Date format. I
have a Macro that re-names a new Worksheet with whatever Date is in a
certain cell, however the worksheet re-names not in Date format but
in numeric format.

Anyone suggest the code that I should insert? My current code is as
below

strSheetName = Worksheets(ActiveSheet.Name).Range("a8")

Where A8 is the document date

Thanks

John


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Re Name a Worksheet as a Date Format

Thanks Ron, works a treat

Rgds

John


"Ron de Bruin" wrote in message
...
Hi John

Use the Format function

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

ActiveSheet.Name = Format(Now, "dd-mm-yy h-mm-ss")


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"John D O'Connor" wrote in message

...
Using a Macron how can you rename a Worksheet using a Date format. I

have a
Macro that re-names a new Worksheet with whatever Date is in a certain

cell,
however the worksheet re-names not in Date format but in numeric format.

Anyone suggest the code that I should insert? My current code is as

below

strSheetName = Worksheets(ActiveSheet.Name).Range("a8")

Where A8 is the document date

Thanks

John






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
Default date format for a new worksheet Kruppy Setting up and Configuration of Excel 1 January 7th 10 05:30 PM
Convert worksheet string name to date format in cell Sabosis Excel Worksheet Functions 2 September 4th 09 05:49 PM
Why all the cells format on my worksheet change to date automatica Eddie Excel Discussion (Misc queries) 2 June 22nd 09 01:28 PM
Date format changes in mail merge using Excel worksheet as data Curious Excel Discussion (Misc queries) 2 February 6th 09 02:20 PM
Excel 2000 worksheet where I want to convert date format Russell-stanely Excel Discussion (Misc queries) 5 December 19th 05 02:02 AM


All times are GMT +1. The time now is 10:48 AM.

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"