[英]Excel Export Classic Ap Leading Zeros
我正在嘗試將前導零添加到我的 excel 導出文件中,但它一直在刪除我的零。
dteThisDob = rs("dob")
strThisDobYear = year(dteThisDob)
strThisDobMonth = right("0" & month(dteThisDob),2)
strThisDobDay = right("0" & day(dteThisDob),2)
strDob = strThisDobMonth & strThisDobDay & strThisDobYear
這給了我 excel 3041975 的輸出。我要找的是 03041975
您可以通過在字符串前加上TAB字符來強制 Excel 不將字符串轉換為數值(並通過這樣做刪除前導零)。
strDob = Chr(9) & strThisDobMonth & strThisDobDay & strThisDobYear
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.