当前位置:网站首页>Excel 比较日器
Excel 比较日器
2022-07-04 05:21:00 【wpyok168】
Private Sub CheckDate_Click()
Dim i As Integer, r As Integer, num As Integer
Dim T1, T2 As Date
Dim lie As Integer
lie = 15 '列号15 即 O 列
num = 0 '统计次校日期到期数量
r = Range("o65536").End(xlUp).Row '统计o列有数据的单元格个数有多少
T2 = Now() - 30 '当前日期往前30天
'T1 = VBA.DateSerial(2022, 6, 26)'日期转换
'T1 = Range("A1").Value'获取单元格的值
'循环单元格数据
For i = 1 To r
T1 = Cells(i, lie)
If (IsEmpty(T1)) Then
Cells(i, lie).Interior.Pattern = xlNone '清除背景色
ElseIf (T1 < T2) Then
'MsgBox ("仪器校验日期过期了")
Cells(i, lie).Interior.Color = 255 '填充红色
num = num + 1
Else
Cells(i, lie).Interior.Pattern = xlNone '清除背景色
End If
Next
If (num > 0) Then
Dim result
result = MsgBox("总共有" + Str(num) + "个设备到期,需安排校正!", vbExclamation)
End If
End Sub
边栏推荐
- left_and_right_net可解释性设计
- [matlab] matlab simulation of modulation system - power spectrum and coherent demodulation of AM modulated signal
- Leetcode 184 Employees with the highest wages in the Department (July 3, 2022)
- [matlab] matlab simulation - narrow band Gaussian white noise
- [matlab] matlab simulation modulation system SSB system
- 724. 寻找数组的中心下标
- 基于单片机的太阳能杀虫系统
- Notepad++ -- display related configurations
- Write a complete answer applet (including single choice questions, judgment questions and multiple topics) (III) single choice questions, judgment questions, and the first question display
- Simulink and Arduino serial port communication
猜你喜欢
2022 R2 mobile pressure vessel filling retraining question bank and answers
Zhongke panyun-2022 Guangdong Trojan horse information acquisition and analysis
How to configure static IP for Kali virtual machine
VB. Net simple processing pictures, black and white (class library - 7)
2022 Guangdong provincial competition - code information acquisition and analysis flag
Programmers don't talk about morality, and use multithreading for Heisi's girlfriend
BUU-Crypto-[GXYCTF2019]CheckIn
Character types of C language
谷歌 Chrome 浏览器将支持选取文字翻译功能
Void convolution, deformable convolution, deformable ROI pooling
随机推荐
Daily question brushing record (12)
VB. Net simple processing pictures, black and white (class library - 7)
Ping port artifact psping
Just do it with your hands 7 - * project construction details 2 - hook configuration
Viewing and using binary log of MySQL
2022 a special equipment related management (elevator) examination questions simulation examination platform operation
1480. 一维数组的动态和
Flink1.13 SQL basic syntax (I) DDL, DML
ETCD数据库源码分析——初始化总览
[QT] create mycombobox click event
XII Golang others
Write a complete answer applet (including single choice questions, judgment questions and multiple topics) (III) single choice questions, judgment questions, and the first question display
Flutter ‘/usr/lib/libswiftCore. dylib‘ (no such file)
Notepad++--显示相关的配置
Unity2D--人物移动并转身
VB. Net GIF (making and disassembling - optimizing code, class library - 5)
LC周赛300
Automated testing selenium foundation -- webdriverapi
LC weekly 300
TCP state transition diagram