0

I debug in code, and I see that the value is in correct format, it just get and set the value only, and it seem like excel take the data as datetime instead of normal string, I try to use NumberFormat and format it to either 1 of this (@, text, number, general) neither 1 is working, any help will be great

ActiveSheet.Range("D" & i).Value = arr(i, 4)

Update 1 Sorry to not mention arr, arr is multi dimension array, it store the column that I read from , I just get the value from excel, and the store in range by looping

4

2 回答 2

1

尝试这个

ActiveSheet.Range("D1").Value = "'" & arr(1, 4)
于 2013-10-18T01:53:03.207 回答
0

我找到了解决方案,虽然它看起来很愚蠢

我将格式更改为

.NumberFormat = "yyyy/mm/dd"

我得到了我想要的价值

于 2013-10-18T03:30:48.150 回答