Stop Excel from automatically converting certain text values to dates

前端 未结 30 3249
别跟我提以往
别跟我提以往 2020-11-22 04:16

Does anyone happen to know if there is a token I can add to my csv for a certain field so Excel doesn\'t try to convert it to a date?

I\'m trying to write a .csv fil

30条回答
  •  庸人自扰
    2020-11-22 05:12

    What I have done for this same problem was to add the following before each csv value: "=""" and one double quote after each CSV value, before opening the file in Excel. Take the following values for example:

    012345,00198475
    

    These should be altered before opening in Excel to:

    "="""012345","="""00198475"
    

    After you do this, every cell value appears as a formula in Excel and so won't be formatted as a number, date, etc. For example, a value of 012345 appears as:

    ="012345"
    

提交回复
热议问题