+ Reply to Thread
Results 1 to 5 of 5

Change date to text with a function in VBE

  1. #1
    Forum Contributor
    Join Date
    02-27-2020
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    425

    Change date to text with a function in VBE

    Hi,

    I am trying to create a macro that uses a function to copy the date from one column as text in a another column. The type of notation should be yyyy-mm. The problem is that i have a dutch excel version and therefore the months and days are swapped.

    Please Login or Register  to view this content.
    Is there a way to do this?
    Any input is appreciated!
    Thanks in advance
    Attached Files Attached Files
    Last edited by MaartenRo; 06-16-2020 at 07:22 AM.

  2. #2
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Change date to text with a function in VBE

    Does the below code do what you need ?

    Please Login or Register  to view this content.
    Last edited by nankw83; 06-10-2020 at 08:12 AM. Reason: Code correction - date as text
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

  3. #3
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,911

    Re: Change date to text with a function in VBE

    You could simply prefix it with an apostrophe:

    Please Login or Register  to view this content.
    Rory

  4. #4
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Change date to text with a function in VBE

    Possibly...
    Please Login or Register  to view this content.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Change date to text with a function in VBE

    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. Replies: 2
    Last Post: 01-31-2017, 10:00 PM
  2. [SOLVED] How to change text date (eg. July) to actual date format?
    By kellyfirth in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-10-2015, 09:49 AM
  3. Change date into text if <today and adding text if cell isblank... into an Array.
    By JasonNeedsHelp in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-29-2013, 12:06 PM
  4. IF Function to change Date, on change of cell.
    By chrisa112 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-15-2012, 11:27 AM
  5. Function to change text color based on date?
    By Ahroo in forum Excel General
    Replies: 2
    Last Post: 08-09-2006, 10:49 AM
  6. Change text to date and check against date in cell
    By RW in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-02-2006, 11:30 AM

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