+ Reply to Thread
Results 1 to 4 of 4

Need Help with Dates Format Function in VBA

  1. #1
    Registered User
    Join Date
    06-08-2019
    Location
    Seattle
    MS-Off Ver
    Windows 2013
    Posts
    5

    Question Need Help with Dates Format Function in VBA

    Hello All,

    I need help with format function in VBA to convert date value. Currently, I am pulling data from another sheet in to my main worksheet. Everything looks great except the two columns that has a date does not always show as date. For example, some comes in as 43019 instead of 04/30/2019.

    Thank you all!

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow

    Hi !

    No need a VBA code, just apply a date format to the cell instead of General format …

  3. #3
    Registered User
    Join Date
    06-08-2019
    Location
    Seattle
    MS-Off Ver
    Windows 2013
    Posts
    5

    Re: Need Help with Dates Format Function in VBA

    Quote Originally Posted by Marc L View Post
    Hi !

    No need a VBA code, just apply a date format to the cell instead of General format …
    This is part of my automated macro. I created a generate report button so that it would go do its own things like finding values, ranges, etc and i want to include this date format function at the end of my code so that it does it automatically.

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow

    First, do not quote all of any previous post, it's just clutter …

    If source data are real dates (so not text) so when using the Range.Copy method the destination cells stay as date !

    As a date is stored within Excel as a number only, like for example 43019, if a date appears as a number in a cell
    so you just have to apply a date format to the cell, no need to convert it as a date is nothing but a number ‼

    Use the VBA NumberFormat cell property and apply the needed date format or just activate the Macro Recorder,
    manually update the cell format to a date format : you will get our own code ! …

+ 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] Convert Dates from Apr 11, 2018 format to numeric format MM/DD/YYYY
    By worswick25 in forum Excel General
    Replies: 16
    Last Post: 04-17-2018, 06:38 AM
  2. Replies: 3
    Last Post: 02-27-2017, 04:38 PM
  3. [SOLVED] IF Function for dates with Conditional Format
    By jenna_max in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-28-2014, 06:36 PM
  4. Convert Dates in 2011:08:17 format into Dates in Excel
    By JessRI in forum Excel - New Users/Basics
    Replies: 12
    Last Post: 09-11-2012, 09:55 AM
  5. Using count function with dates in ddmmyy hhmm format
    By Apel in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-04-2009, 02:15 PM
  6. Conditional Format Dates in a Calender when Matches dates in a list
    By Lungfish in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-14-2009, 06:23 AM
  7. [SOLVED] the dates on cell format make different dates.
    By date formats morph the dates/chang case in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 04-17-2005, 10:07 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