+ Reply to Thread
Results 1 to 2 of 2

VBA Code or Formula to Convert format of extracted Data

  1. #1
    Registered User
    Join Date
    05-30-2013
    Location
    Ohio
    MS-Off Ver
    Excel 2003
    Posts
    28

    VBA Code or Formula to Convert format of extracted Data

    I have VBA code the extracts data from a source and puts it into excel. I need to change the format of some of the extracted data so i can use it for a VLookup formula. Reference the attached example. Columns A AND B have the extraced data which are dates. In Columns C and D or E and F I have typed what I would like the data to look like so I can use in a Vloolup formula. Is there VBA or a formula that word change the format of the dates in Columns A and B to look like C and D or E and F. The changed format could be moved to any new cells or rows.

    Thanks,
    Brian
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: VBA Code or Formula to Convert format of extracted Data

    Hello Bpd,

    Here is a non VBA option. You can use formulas to convert the values to dates and then format the columns to display the dates in the format you want.

    Cell C5 formula: =IF(A5="", "",DATEVALUE(REPLACE(REPLACE(A5,3,1,"/"),6,1,"/")))
    Cell D5 formula: =IF(B5="","",DATEVALUE(REPLACE(REPLACE(REPLACE(B5,1,2,""),4,1,"/"),7,1,"/")))
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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. Need code to convert date as format of dd-mmm-yyy at once click
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-13-2013, 04:52 AM
  2. [SOLVED] Require vba or formula for convert general format data in date format
    By santosh226001 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-10-2013, 03:53 AM
  3. Need Formula/VBA Code to convert date in String Format to Normal Date format
    By Karthik Sen in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-18-2012, 04:54 AM
  4. VBA Code to copy the format from source data to extracted report
    By rav4u_tom in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-08-2010, 03:53 AM
  5. Replies: 0
    Last Post: 04-20-2010, 01:34 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