A
ajd
Hi All,
How can I format some cells use the system default date format in Excel ?
So that when the regional settings in Windows changes, the date format will
be also changed accordingly.
Although without numberFormat does excel function automatically, however
here we have an array, I have to assign the numberFormat because of the
other cells.
A code expamle is listed as following: Thanks in advance.
Zuxiang DAI
sub doIt()
Dim aValues(0 To 1) As Variant
Dim aFormats(0 To 1) As String
aValues(0) = "000100.123456000"
aFormats(0) = "@"
aValues(1) = #2/10/2006#
'how can I tell excel this should be a system default date format?
aFormats(1) = ????????
Application.ErrorCheckingOptions.NumberAsText = False
Range("A1", "B1").numberFormat = aFormats
Range("A1", "B1").Value = aValues
End Sub
How can I format some cells use the system default date format in Excel ?
So that when the regional settings in Windows changes, the date format will
be also changed accordingly.
Although without numberFormat does excel function automatically, however
here we have an array, I have to assign the numberFormat because of the
other cells.
A code expamle is listed as following: Thanks in advance.
Zuxiang DAI
sub doIt()
Dim aValues(0 To 1) As Variant
Dim aFormats(0 To 1) As String
aValues(0) = "000100.123456000"
aFormats(0) = "@"
aValues(1) = #2/10/2006#
'how can I tell excel this should be a system default date format?
aFormats(1) = ????????
Application.ErrorCheckingOptions.NumberAsText = False
Range("A1", "B1").numberFormat = aFormats
Range("A1", "B1").Value = aValues
End Sub