Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By Joe4

Convert Date to String

This is a discussion on Convert Date to String within the Excel Questions forums, part of the Question Forums category; Via VBA , I am cutting and pasting a row from the current worksheet to a "done" worksheet which lists ...

  1. #1
    Board Regular
    Join Date
    Nov 2003
    Posts
    76

    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
    27,284

    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")
    ZubaZ likes this.
    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

    Default Re: Convert Date to String

    Works Perfect ... Thanks!

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