'还好,还在,功能不是很完善,你可以作相应的修改
Private Function LeftSpaces(ByVal ColPos As Integer, ByVal Date_Str As String) As Integer
Dim Str_Pos As Integer
Dim ByteWidth As Integer
Dim Grid_Len As Integer
Dim Date_Len As Integer
Dim Date_ChineseCount As Integer
Date_ChineseCount = 0
ByteWidth = 90
If ColPos = ResultTable.ResultGrid.Cols - 2 Then
Grid_Len = 630
Else
Grid_Len = 1080
End If
Date_Len = Len(Date_Str)
For Str_Pos = 1 To Len(Date_Str)
If Asc(Mid(Date_Str, Str_Pos, 1)) < 0 Then
Date_ChineseCount = Date_ChineseCount + 1
End If
Next Str_Pos
Date_Len = Date_Len + Date_ChineseCount
If Date_Len = 12 Then
LeftSpaces = Grid_Len / ByteWidth - Date_Len + 1
Else
LeftSpaces = Grid_Len / ByteWidth - Date_Len - 1
End If