以下是引用那么的帅在2010-7-12 15:47:00的发言: 上传附件,并把你的要求讲清楚 帅老师: 下面是在用条件格式录制修改后的一段代码,可是运行时出现类型不匹配的错误?,希望帅老师帮忙更改和优化一下,并且能在sheet1——5表中共用,在此谢谢了! Sub Macro()' ' 宏由 微软用户 录制,时间: 2010-7-10 Range("CH:CN,DZ:ET").Select Range("DZ1").Activate Selection.FormatConditions.Delete Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _ Formula1:="=""★" Or "=""■" Or "=""▲" Or "=""◎" '当等于★、■、▲、◎时为粉红字 With Selection.FormatConditions(1).Font .Bold = True .Italic = False .ColorIndex = 7 End With Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _ Formula1:="=""☆" Or "=""□" Or "=""△" Or "=""㊣" With Selection.FormatConditions(2).Font .Bold = False .Italic = True .ColorIndex = 3 End With Columns("CH:GP").Select With Selection.Font .Name = "宋体" .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With With Selection.Font .Name = "宋体" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With Selection.ColumnWidth = 2.5 Selection.ColumnWidth = 3.13 End Sub
VlHMXn7N.zip
(90.2 KB, 下载次数: 5)
|