How to Use VBA to convert the date format of text files

Source: Internet
Author: User

I used VBA to convert an Excel file to a file, but the date format in the converted text file is not the same as that in Excel, and the date format in Excel is, after the text format is converted, the date format is changed to 11/8/2008. The date format in the converted text format file remains unchanged from 2008 to 11-8. Thank you first.

 

Change a paragraph
Selection. Copy
Workbooks. Add (1)
With activeworkbook. activesheet
. Paste
For each cel in. Range (. [B2],. [b65536]. End (xlup ))
If isdate (CEL) Then cel. value = "'" & format (CEL, "yyyy-mm-dd ")
Next
End
Application. cutcopymode = false

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.