EXCEL 10版 默认日期格式与电脑默认日期不一致 RRS feed

  • 问题

  •   上级公司下发的数据及系统下载的数据,日期格式都是yyy-mm-dd,但我的10版就是yyy-m-dd,实在是不适应啊。

                         2、在excel “格式”->“数字”->“日期”之“区域设置(国家/地区)”  修改为“中文(中国)”                     

                         3、在excel “文件”选项卡->“选项”->“语言”内的默认选项全部设置为了与windows匹配。


    2016年7月15日 10:43


  • 我查找了一下,Excel的格式还是依赖于系统控制面板中设定的格式。

    The default date/time format depends on the date/time format in Windows. So, to change the default format, you need to change the format in Windows.

    这一步,“将短日期格式已经改成”,长日期有没有修改? 如果可以,请将长日期也修改一下。

    It completely depends on your system date and time format:

    1. Go to Control Panel. 
    2. Click on "Region and Language". 
    3. Click on "change date, time and number format". 
    4. Set "short date", "long date", "short time" and "long time".


    Please this process step by step and you will have what you want.

    1. create a new excel file and save it to this folder name is date-formatted C:\Users\Username\Application Data\Microsoft\Excel\XLSTART (change username as per your PC)

    2. open the file which you just created date-formatted

    3. now right click on any opened Worksheet Tab and click View Code

    Paste the following code in worksheet code module

    right click on the worksheet tab, select "View Code" to bring up the VBA editor.

    Paste this code into the worksheet module code window that is displayed:

    Private Sub Worksheet_Change(ByVal Target As Range)

        If Target.NumberFormat = "d-mmm" Then
            Target.NumberFormat = "dd/mm/yyyy"
        End If

    End Sub

    专注于.NET ERP/CRM开发框架,C/S架构,SQL Server + ORM(LLBL Gen Pro) + Infragistics WinForms

    2016年7月16日 0:28