|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub 宏1()
- a = Sheet1.[a1048576].End(xlUp).Row
- Sheet2.Range("A1:R31").Value = Sheet1.Range("A1:R31").Value
- Sheet1.Range("A1:R31").Copy
- Sheet2.Range("A1:R31").PasteSpecial
- For c = 2 To a
- d = 0
- For b = 3 To 18
- If Sheet1.Cells(c, b).Value <> "" Then
- If Sheet1.Cells(c, b).Font.Color = vbBLK Then
- d = d - 20
- ElseIf Sheet1.Cells(c, b).Font.Color = vbRed Then
- d = d + 1
- End If
- End If
- Sheet2.Cells(c, 19).Value = d
- Next b
- Next c
- ActiveWorkbook.Worksheets("效果").Sort.SortFields.Clear
- ActiveWorkbook.Worksheets("效果").Sort.SortFields.Add2 Key:=Range("S2:S31"), _
- SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
- With ActiveWorkbook.Worksheets("效果").Sort
- .SetRange Range("A1:S31")
- .Header = xlYes
- .MatchCase = False
- .Orientation = xlTopToBottom
- .SortMethod = xlPinYin
- .Apply
- End With
- Columns("S:S").Delete Shift:=xlToLeft
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|