Convert Date to String

Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Convert Date to String

  1. #1
    Board Regular
    Join Date
    Nov 2003
    Posts
    76
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Convert Date to String

     
    Via VBA, I am cutting and pasting a row from the current worksheet to a "done" worksheet which lists all jobs done. This "DONE" worksheet is eventually exported to a dbf.

    I would like to update a cell in the "done" worksheet to be that of today's date to reflect date of transfer. Unfortunately, the column I have to work with is a formatted text column. Is there a way to convert a date (i.e. now() ) to a string?

    Your help would be appreciated!

  2. #2
    MrExcel MVP
    Moderator
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    42,657
    Post Thanks / Like
    Mentioned
    15 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Convert Date to String

    See the FORMAT text function in VBA. It works very much like the TEXT Excel function.

    i.e.
    MYSTRING=FORMAT(NOW(),"yyyymmdd")
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  3. #3
    Board Regular
    Join Date
    Nov 2003
    Posts
    76
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Convert Date to String

      
    Works Perfect ... Thanks!

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com