|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub test0()
- Dim data, results() As Long
- Dim i As Long, j As Long, k As Long, p As Long, x As Long
- Sheet2.Activate
- x = Range("AY3").Value + 2
- k = -Int(-35 / x)
- data = Range("C4:G4", Range("C4:G4").End(xlDown)).Value
- ReDim results(1 To UBound(data), 1 To 7)
- For i = 1 To UBound(data)
- For j = 1 To UBound(data, 2)
- p = -Int(-data(i, j) / k)
- If x = 3 Then If data(i, j) = 24 Then p = 3
- results(i, p) = results(i, p) + 1
- Next
- Next
- With Range("AZ4").Resize(UBound(results), UBound(results, 2)) '自行 改为 Range("AQ4")
- .ClearContents
- .Resize(, x).Value = results
- End With
- Beep
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|