一.excel
excel 使用vba
使用录制宏
Sub copy1()
Dim q%, x%, y%
For i = 0 To 52
x = 2 + 181 * i
y1 = 10 + 3 * i
Range(Cells(x, 1), Cells(x, 2)).copy Range(Cells(1, y1), Cells(1, y1 + 1)) '用来选择区域'
Range(Cells(1, 6), Cells(1, 8)).copy Range(Cells(2, y1), Cells(2, y1 + 2))
Range(Cells(x, 6), Cells(x + 180, 8)).copy Range(Cells(3, y1), Cells(183, y1 + 2))
Next
End Sub
统计个数
Sub 评定等级()
Dim i As Integer
Dim x100 As Integer
x100 = 0
Dim x200 As Integer
x200 = 0
Dim x300 As Integer
x300 = 0
Dim x400 As Integer
x400 = 0
Dim up400 As Integer
up400 = 0
Dim j As Integer
Dim modx As Integer
For j = 3 To 19
modx = j Mod 2
If (modx = 1) Then
For i = 6 To 17
t = Sheet1.Cells(i, j).Value
If (t < 100) And (t <> "") Then
x100 = x100 + 1
ElseIf (t < 200) And (t <> "") Then
x200 = x200 + 1
ElseIf (t < 300) And (t <> "") Then
x300 = x300 + 1
ElseIf (t < 400) And (t <> "") Then
x400 = x400 + 1
ElseIf (t >= 400) And (t <> "") Then
up400 = up400 + 1
End If
Next
End If
Next
For j = 3 To 19
modx = j Mod 2
If (modx = 1) Then
For i = 20 To 31
t = Sheet1.Cells(i, j).Value
If (t < 100) And (t <> "") Then
x100 = x100 + 1
ElseIf (t < 200) And (t <> "") Then
x200 = x200 + 1
ElseIf (t < 300) And (t <> "") Then
x300 = x300 + 1
ElseIf (t < 400) And (t <> "") Then
x400 = x400 + 1
ElseIf (t >= 400) And (t <> "") Then
up400 = up400 + 1
End If
Next
End If
Next
Sheet1.Cells(34, 2).Value = x100
Sheet1.Cells(35, 2).Value = x200
Sheet1.Cells(36, 2).Value = x300
Sheet1.Cells(37, 2).Value = x400
Sheet1.Cells(38, 2).Value = up400
Sheet1.Cells(34, 3).Value = x100 / 182
Sheet1.Cells(35, 3).Value = x200 / 182
Sheet1.Cells(36, 3).Value = x300 / 182
Sheet1.Cells(37, 3).Value = x400 / 182
Sheet1.Cells(38, 3).Value = up400 / 182
End Sub