+ Reply to Thread
Results 1 to 3 of 3

Converting Date values into string values?

  1. #1
    Registered User
    Join Date
    06-13-2016
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    95

    Converting Date values into string values?

    I have a loop that is going through all the dates within a submitted range by a user.

    For each date in the loop though, I want to format it back to string value such as 09/01/2016 ---> 09012016 to do a file search in a directory with this at the end of the file name.
    Only thing is, I'm confused how to make the date back to a string value in that format.

    Cstr did not work as planned, any other ideas?

    The below is my code:

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,443

    Re: Converting Date values into string values?

    Instead of the CStr function, I think you are looking for the Format() function: https://msdn.microsoft.com/en-us/lib.../gg251755.aspx if it will accept "mmddyyyy" as the format code.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    06-13-2016
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    95

    Re: Converting Date values into string values?

    Just figured it out, and it was a lot simpler than I was thinking earlier!

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Formula for converting a date to quarter and leaving blank cell for no date values
    By jayc2111 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-10-2019, 12:57 AM
  2. How can i avoid the String of Characters While converting fraction values
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-10-2014, 07:52 AM
  3. Replies: 5
    Last Post: 06-04-2014, 10:32 AM
  4. Combining values in a range and converting to single string variable
    By beat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-30-2014, 10:46 AM
  5. How to stop automatically converting text columns to date values
    By andy.k in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-07-2013, 10:55 AM
  6. [SOLVED] Decimal moving and values lost when converting from string
    By JimmyA in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-28-2012, 05:04 PM
  7. Replies: 5
    Last Post: 11-08-2012, 03:38 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1