昵称:清霜残雪 头衔:版主 积分:303分 注册:2009-7-15
状态:离线
|
|
以下是表格中有重复值公式时候标色的代码,希望大家参考并提出宝贵意见 sub 重复值标色() Dim rng1 As Range, data As Range Dim b As Integer Set rng1 = Range("n2:n117")‘重复值区域 b = Application.WorksheetFunction.Max(rng1)‘重复值个数 Range("B2:B117").Select Selection.FormatConditions.Delete For X = 2 To b + 1‘用查找 Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _ Formula1:="=$M$" & X Selection.FormatConditions(X - 1).Interior.ColorIndex = 3 Next X End Sub
|
明强、敬恕,如履薄冰。 自信、努力、实现理想。 | |