åå 天åçä¸ä¸ªå°ç¨åº ä¾åè
Sub tus_Main()
Dim sArr(1 To 7) As String
Application.ScreenUpdating = False
sArr(1) = "综ååå
¬å®¤"
sArr(2) = "管ç½ç®¡çé¨"
sArr(3) = "å
¬æåå
¬å¸"
sArr(4) = "å
æåå
¬å¸"
sArr(5) = "ä¸ææ°´å"
sArr(6) = "ç²åå¡æ°´å"
sArr(7) = "å
ææ°´å"
'sArr(8) = "å¾
æ´æ¹éæ£"
For i = 1 To 7
Call tuS(sArr(i))
Next i
Application.ScreenUpdating = True
Sheets("æ±æ»è¡¨").Activate
End Sub
Sub tuS(sName As String)
Dim hH As Integer
Dim fxJb As Integer 'é£é©çº§å«
Const ksLh = 1, jsLh = 17 'kslh-æ¶è²çå¼å§åå· jslh-æ¶è²çç»æåå·
Const ksHH = 4
hH = ksHH
Sheets(sName).Activate
Do While Cells(hH, 4) <> ""
fxJb = Cells(hH, 10).Value
Range(Cells(hH, ksLh), Cells(hH, jsLh)).Select
If Cells(hH, 17) = "å¾
æ´æ¹" Then
Select Case fxJb
Case 1
Call color_1
Case 2
Call color_2
Case 3
Call color_3
Case 4
Call color_4
Case 5
Call color_5
End Select
End If
hH = hH + 1
Loop
End Sub
Sub color_1()
'
'å±é©ç¨åº¦1级 åºè²ä¸ºçº¢è²ï¼åä½ä¸ºç½è²
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
With Selection.Font
'.Name = "仿å®"
'.FontStyle = "å ç²"
'.Size = 18
'.Strikethrough = False
'.Superscript = False
'.Subscript = False
'.OutlineFont = False
'.Shadow = False
'.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
'.ThemeFont = xlThemeFontNone
End With
End Sub
Sub color_2()
'
'å±é©ç¨åº¦2级 åºè²ä¸ºåå¡è²ï¼åä½ä¸ºç½è²
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent6
.TintAndShade = 0
.PatternTintAndShade = 0
End With
With Selection.Font
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
End With
End Sub
Sub color_3()
'
'å±é©ç¨åº¦3级 åºè²ä¸ºé»è²ï¼åä½ä¸ºé»è²
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
With Selection.Font
.ColorIndex = xlAutomatic
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
End Sub
Sub color_4()
'
'å±é©ç¨åº¦4级 åºè²ä¸ºèè²ï¼åä½ä¸ºé»è²
With Selection.Font
.ColorIndex = xlAutomatic
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 16776960
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End Sub
Sub color_5()
'
' å
许èå´å
æ å·²æ´æ¹
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark2
.TintAndShade = 0
.PatternTintAndShade = 0
End With
With Selection.Font
.ColorIndex = xlAutomatic
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
End Sub
Sub å®8()
'
' å®8 å®
'
'
Application.ReferenceStyle = xlA1
Range("C5:I5").Select
Selection.FormulaR1C1 = "=SUM(R[1]C:R[5]C)"
Range("B5:B10").Select
Selection.FormulaR1C1 = "=SUM(RC[1]:R[1]C[7])"
Range("B5:B10").Select
Selection.ClearContents
Range("B5:B10").Select
Selection.FormulaR1C1 = "=SUM(RC[1]:RC[7])"
End Sub
温馨提示:答案为网友推荐,仅供参考