Dim str As String
Dim i As Integer
Dim a As Range
Set a = Range("a1:a10") '选择的范围
For Each b In a
str = b.Cells
For i = 1 To Len(str)
If Asc(Mid(str, i, 1)) <0 Then
b.Cells.Font.Name = "黑体"
Else
b.Cells.Font.Name = "Arial"
End If
Next i
Next
End Sub
Sub s()With [a6:u2000]
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
With .Font
.Name = "宋体"
.Size = 11
.Bold = True
.ColorIndex = 8
End With
.FormatConditions.Delete
.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=""√"""
.FormatConditions(.FormatConditions.Count).Font.ColorIndex = 5
.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=""X"""
.FormatConditions(.FormatConditions.Count).Font.ColorIndex = 3
End With
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)