'据我了解,试一试这个算法: Private Sub Form_Load() Dim lngResult As Long Dim strDate As String lngResult = CLng("&H" & "34AA") strDate = Format(lngResult \ 512 + 1980, "0000") & "." & _ Format(lngResult \ 32 And 15, "#0") & "." & _ Format(lngResult And 31, "#0") End Sub
>比如 aa 34 转成 2006.5.10不知道你的 16 进制格式是高位在前,还是低位在前。假定低位在前:debug.print cdate(val("&H34aa" + 25000))最好再给一个不同日期的数据例子。
Private Sub Form_Load()
Dim lngResult As Long
Dim strDate As String lngResult = CLng("&H" & "34AA")
strDate = Format(lngResult \ 512 + 1980, "0000") & "." & _
Format(lngResult \ 32 And 15, "#0") & "." & _
Format(lngResult And 31, "#0")
End Sub