比较不同的单元格的值,设置不同的颜色
来源:互联网 发布:功夫全球票房 知乎 编辑:程序博客网 时间:2024/05/16 12:49
Sub SetDifferentColor()'' 比较不同的单元格的值,设置不同的颜色' Dim colors As Variant colors = Array(21, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20) Dim colname As String Dim lastindex As Integer Dim i As Integer Dim target As String Dim model As String Dim colorindex As Integer colname = InputBox("请输入需要比较的列") If Len(colname) = 0 Then Exit Sub End If lastindex = Range(colname & 65536).End(xlUp).Row For i = lastindex To 1 Step -1 model = Range(colname & i).Value colorindex = Range(colname & i).Interior.colorindex If colorindex = xlNone Then For ii = i - 1 To 1 Step -1 target = Range(colname & ii).Value If model = target Then Range(colname & i).Interior.colorindex = colors(i Mod 20) Range(colname & ii).Interior.colorindex = colors(i Mod 20) End If Next End If Next End Sub
0 0
- 比较不同的单元格的值,设置不同的颜色
- aspxGridview 根据单元格值得不同,设置单元格字体的颜色
- Excel自动筛选、单元格选择不同的值显示不同的颜色、第一行不动
- 不同的值,行的颜色不同
- jqgrid setCell 根据单元格 值的不同 设置不同的样式 属性
- listctrl根据不同的内容设置不同的颜色
- UILabel设置不同的字体不同的颜色
- TextView 设置不同的颜色,点击响应不同的操作。
- EXCEL 相同日期所在的不同单元格使用相同颜色
- IOS 单元格内每格不同的颜色…
- reportservice报表单元格根据条件显示不同的颜色
- 代码设置按钮不同状态的颜色
- 动态设置不同的行字体颜色
- UILabel设置不同的字体颜色
- highcharts column设置不同的颜色
- extjs ColumnChart 设置不同的颜色
- TextView设置不同的字体大小,颜色,类别
- UILabel设置不同的字体颜色
- 二分法-长城守卫(Beijing Guards, CERC 2004, LA 3177)
- 工作日志2016-5-9
- 在tomcat下context.xml中配置各种数据库连接池
- 动不动就说要创业,然而大多数创业者并不知道自己想要什么
- mock平台架构及实现(持续更新)
- 比较不同的单元格的值,设置不同的颜色
- 生产者消费者模型你知道多少
- c++中位运算
- linux 常用命令
- 让客户自我成交的秘笈
- (Android)The connection to adb is down, and a severe error has occured.解决方法
- C++设计模式浅识职责链模式
- iOS sqlite3数据库解析
- 生产者消费者模型(二)-引入ArrayBlockingQueue