EXCEL跨表比较两列,并填充新值背景
2024-09-28 14:18:01
Sub FillNewToYellow()
Dim dic
Dim oldArr(), updatedArr() On Error Resume Next
If Worksheets("old") Is Nothing Then
MsgBox "Missing old sheet"
ElseIf Worksheets("updated") Is Nothing Then
MsgBox "Missing updated sheet"
Else
Set dic = CreateObject("Scripting.Dictionary")
ActiveWorkbook.Sheets("old").Activate
oldArr = Range("B1:B" & ActiveSheet.UsedRange.Rows.Count) For i = 1 To UBound(oldArr)
dic(oldArr(i, 1)) = ""
Next ActiveWorkbook.Sheets("updated").Activate
updatedArr = Range("B1:B" & ActiveSheet.UsedRange.Rows.Count) For i = 1 To UBound(updatedArr)
If dic.exists(updatedArr(i, 1)) = False Then
Rows(i & ":" & i).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535 'Yellow
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
Next
End If
End Sub
最新文章
- SQL Server游标
- [转]SIFT特征提取分析
- POJ2186 Popular Cows 强连通分量tarjan
- SOA,ESB 与 SCA
- move 表索引失效
- Ray Tracing
- 新随笔ps泡泡制作
- 怎么用DreamWare新建立一个静态网站的站点
- C语言程序设计第五次作业——循环结构(1)
- angular脚手架搭建
- [NOIP2017普及组]棋盘
- day52 js--- bom dom
- c++之__attribute__((unused))
- CEF C++环境搭建
- js 动态绑定事件 on click 完美解决绑定不成功
- Scalable Object Detection using Deep Neural Networks译文
- Codeforces Round #196 (Div. 2) A. Puzzles 水题
- SpringCloud初体验:二、Config 统一配置管理中心
- 深入理解Java虚拟机---类加载机制(简略版)
- android之Activity.startManagingCursor方法详解