|
mjzxlmg 发表于 2012-8-4 09:29
Sub 转置0811()
Dim arr, crr, grr, frr(), drr(), brr(), i&, ir&, k&, n&, j&, x&, y&, d
Set d = CreateObject("scripting.dictionary")
arr = Sheet1.UsedRange
For i = 2 To UBound(arr)
d(arr(i, 1) & "|" & arr(i, 2) & "|" & arr(i, 3)) = d(arr(i, 1) & "|" & arr(i, 2) & "|" & arr(i, 3)) & "|" & arr(i, 4)
Next i
[g2].Resize(d.Count) = Application.Transpose(d.keys)
[g2].Resize(d.Count).TextToColumns otherchar:="|", other:=True
[j2].Resize(d.Count) = Application.Transpose(d.items)
[j2].Resize(d.Count).TextToColumns otherchar:="|", other:=True
Application.ScreenUpdating = False
For j = 2 To [h65536].End(xlUp).Row
For k = 11 To 17
If Cells(j, k + 1).Value - Cells(j, k).Value < 0.015 Then
Cells(j, k + 1).Delete Shift:=xlToLeft
End If
If Cells(j, 11).Value > 0.45 Then
Cells(j, 11).Insert Shift:=xlToRight
End If
If Cells(j, 12).Value > 0.65 Then
Cells(j, 12).Insert Shift:=xlToRight
End If
Next
Next
Application.ScreenUpdating = True
End Sub |
|