Thread: Date formatting
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Lasca Lasca is offline
external usenet poster
 
Posts: 11
Default Date formatting

I want to use a date for as an sheet name, Ie 13-Sep-08 or 13-09-08 ( this
will be set by using vb code).
My problem is the system date is in dd/mm/yyyy format and the "/" can not be
used for sheetname. How do i go about replacing the "/" with "-" in my vb
code so that it wil be an acceptable format.

Here is my code that I used


Dim SHEETNAME As String

SHEETNAME = Date

Sheets("IDT").Select
Sheets("IDT").Copy After:=Sheets(2)
Sheets("IDT (2)").Name = SHEETNAME