|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Public Sub filter()
- Dim ws As Worksheet
- Dim rng As Range
- Dim cel As Range, arr(), brr(), crr()
- Dim myrng As Range
- Dim nm As Name
- Set ws = Worksheets("sheet1")
- ws.Activate
- crr = Array("语文", "数学", "英语", "物理", "化学", "政治", "历史", "科目1", "科目2")
-
- For m = 0 To 8
- ws.Activate
- a = Range("总分校排").Count
- k = 0
- ReDim arr(0 To Range("总分校排").Count, 0 To 3)
- brr = Array("姓名", crr(m) & "分数", crr(m) & "校排", "总分校排")
- For i = 2 To Range("总分校排").Count
- If Range("总分校排").Cells(i).Value - Range(crr(m) & "校排").Cells(i).Value > 80 Then
- For j = 0 To 3
- arr(k, j) = Range(brr(j)).Cells(i).Value
- Next
- k = k + 1
- End If
- Next
- Worksheets("优生弱科名单").Activate
- Set myrng = Range("B4").Offset(0, 4 * m).Resize(UBound(arr), 4)
- myrng = arr
- Erase arr
- Next
- End Sub
复制代码
本来说用名称做 后面感觉有点多余 |
|