+ Reply to Thread
Results 1 to 3 of 3

Errors when switching date from long format back to short format

  1. #1
    Registered User
    Join Date
    07-01-2021
    Location
    New Zealand
    MS-Off Ver
    Office 365
    Posts
    3

    Errors when switching date from long format back to short format

    I have a userform where combobox 7 is being populated from a list of dates in column Z on the sheet "List".
    In the sheet the dates are in the format "dd/mm/yyyy" .When the combobox is populated it converts them to the format "dddd d mmmm yyyy" using the following code:

    Please Login or Register  to view this content.
    The dates are populating into the combobox perfectly fine. The problem is that when I try to convert it back to the original format, the macro doesn't recognize it as a date.

    This is the code I'm using to convert the selected date back to the original format:

    Please Login or Register  to view this content.
    When I execute this code, I get a "type mismatch" error. Any ideas where I'm going wrong?

  2. #2
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Errors when switching date from long format back to short format

    That is because you have the "date" preceded by the day name. I think this should work for you though...
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-01-2021
    Location
    New Zealand
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Errors when switching date from long format back to short format

    Works great, thank you!

+ 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. Condense Long strings with repeating patterns into algebraic short format
    By sdl2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-03-2020, 04:25 PM
  2. Switching Date Format
    By Mjoyce1994 in forum Excel General
    Replies: 1
    Last Post: 09-25-2019, 04:31 PM
  3. Format Cell value (ex. 20170918) to Short Date MM/DD/YYYY
    By sunjam in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-19-2017, 10:18 PM
  4. [SOLVED] Excel Monthveiw Change the date format to Short Date
    By nigelog in forum Excel General
    Replies: 2
    Last Post: 09-09-2016, 12:38 PM
  5. [SOLVED] VBA For changing Short Date Format in Region & Language setting
    By bdouglas1011 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-08-2014, 09:43 PM
  6. [SOLVED] Date format switching to *dd/mm/yy
    By KAPearson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-21-2012, 12:31 PM
  7. Userform date format reverting back to us format on change event
    By jpruffle in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2009, 12:34 PM

Tags for this Thread

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