X
xh416
Unregistered / Unconfirmed
GUEST, unregistred user!
Sub SortTable(top, left, right, bottom, Col)
Range(Cells(top, left), Cells(bottom, right)).Select
Selection.Sort Key1:=Columns(Col), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, SortMethod _
:=xlPinYin
End Sub
Sub SetWidth(ColIndex, B_Row, E_Row, MinW)
Dim temp_Width, temp_ChrWidth, tempLen Asdo
uble
Dim tempCon As String
Dim charVal As Integer
Dim flag As Boolean
Dim strlen As Integer
Dim K As Integer
temp_Width = MinWidth
If MinW > MinWidth then
temp_Width = MinW
End If
For I = B_Row To E_Row
temp_ChrWidth = Cells(I, ColIndex).Font.Size / 11
If IsNull(temp_ChrWidth) then
temp_ChrWidth = 9
End If
tempCon = Format(Cells(I, ColIndex))
flag = False
For K = 1 To Len(tempCon)
charVal = Asc(Mid(tempCon, K, 1))
If charVal = 10 then
flag = True
GoTo 100:
End If
Next
100:
If flag = True then
strlen = K
else
strlen = Len(tempCon)
End If
tempLen = strlen * temp_ChrWidth
If tempLen > temp_Width And tempLen < MaxWidth then
temp_Width = tempLen
End If
Next
Columns(ColIndex).ColumnWidth = temp_Width
End Sub
Sub CellsCopy(Sheet_Targ, Sheet_Sour, s_Left, s_Top, s_Right, s_Bottom, t_Left, t_Top)
Sheets(Sheet_Sour).Activate
Range(Cells(s_Top, s_Left), Cells(s_Bottom, s_Right)).Select
Application.CutCopyMode = xlCopy
Selection.Copy
Sheets(Sheet_Targ).Activate
Range(Cells(t_Top, t_Left), Cells(t_Top, t_Left)).Select
ActiveSheet.Paste
End Sub
Range(Cells(top, left), Cells(bottom, right)).Select
Selection.Sort Key1:=Columns(Col), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, SortMethod _
:=xlPinYin
End Sub
Sub SetWidth(ColIndex, B_Row, E_Row, MinW)
Dim temp_Width, temp_ChrWidth, tempLen Asdo
uble
Dim tempCon As String
Dim charVal As Integer
Dim flag As Boolean
Dim strlen As Integer
Dim K As Integer
temp_Width = MinWidth
If MinW > MinWidth then
temp_Width = MinW
End If
For I = B_Row To E_Row
temp_ChrWidth = Cells(I, ColIndex).Font.Size / 11
If IsNull(temp_ChrWidth) then
temp_ChrWidth = 9
End If
tempCon = Format(Cells(I, ColIndex))
flag = False
For K = 1 To Len(tempCon)
charVal = Asc(Mid(tempCon, K, 1))
If charVal = 10 then
flag = True
GoTo 100:
End If
Next
100:
If flag = True then
strlen = K
else
strlen = Len(tempCon)
End If
tempLen = strlen * temp_ChrWidth
If tempLen > temp_Width And tempLen < MaxWidth then
temp_Width = tempLen
End If
Next
Columns(ColIndex).ColumnWidth = temp_Width
End Sub
Sub CellsCopy(Sheet_Targ, Sheet_Sour, s_Left, s_Top, s_Right, s_Bottom, t_Left, t_Top)
Sheets(Sheet_Sour).Activate
Range(Cells(s_Top, s_Left), Cells(s_Bottom, s_Right)).Select
Application.CutCopyMode = xlCopy
Selection.Copy
Sheets(Sheet_Targ).Activate
Range(Cells(t_Top, t_Left), Cells(t_Top, t_Left)).Select
ActiveSheet.Paste
End Sub