Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 11070|回复: 27

[已解决]自动到期提醒

[复制链接]
发表于 2012-10-5 12:41 | 显示全部楼层 |阅读模式
管理人员名册.rar (22.69 KB, 下载次数: 116)
发表于 2012-10-5 13:06 | 显示全部楼层
可以在合同到期日那一列加条件格式嘛,快到期的红色背景
回复

使用道具 举报

 楼主| 发表于 2012-10-5 13:12 | 显示全部楼层
hwc2ycy 发表于 2012-10-5 13:06
可以在合同到期日那一列加条件格式嘛,快到期的红色背景

格式还要自己去找! 我要让自己跳出个提标框!方便一点
回复

使用道具 举报

发表于 2012-10-5 13:33 | 显示全部楼层
  1. Private Sub Workbook_Open()
  2.     Dim arrName, arrDate
  3.     Dim iRow As Long, i As Long
  4.     Dim sName As String
  5.     Dim dDate As Date
  6.    
  7.     iRow = [a2].End(xlDown).Row
  8.     If Cells(iRow, 1) = "" Then Exit Sub
  9.     arrName = Range("h2:h" & iRow).Value
  10.     arrDate = Range("w2:w" & iRow).Value
  11.     For i = 1 To UBound(arrName)
  12.         dDate = arrDate(i, 1)
  13.         If Date < dDate And dDate - Date <= 15 Then
  14.             sName = IIf(sName = "", arrName(i, 1), sName & vbCr & arrName(i, 1))
  15.         End If
  16.     Next

  17.     If Len(sName) > 0 Then
  18.         MsgBox "合同马上到期人员名单:" & vbCr & sName
  19.     End If
  20.    
  21. End Sub
复制代码
回复

使用道具 举报

发表于 2012-10-5 13:40 | 显示全部楼层
  1. Private Sub Workbook_Open()
  2.     Dim arrName, arrDate
  3.     Dim iRow As Long, i As Long
  4.     Dim sName As String
  5.     Dim dDate As Date
  6.    
  7.     iRow = [a2].End(xlDown).Row
  8.     If Cells(iRow, 1) = "" Then Exit Sub
  9.     arrName = Range("h2:h" & iRow).Value
  10.     arrDate = Range("w2:w" & iRow).Value
  11.     For i = 1 To UBound(arrName)
  12.         dDate = arrDate(i, 1)
  13.         If Date < dDate And dDate - Date <= 15 Then
  14.             sName = IIf(sName = "", arrName(i, 1) & "   " & arrDate(i, 1), sName & vbCr & arrName(i, 1) & "   " & arrDate(i, 1))
  15.         End If
  16.     Next

  17.     If Len(sName) > 0 Then
  18.         MsgBox "合同马上到期人员名单:" & vbCr & sName
  19.     End If
  20.    
  21. End Sub
复制代码
回复

使用道具 举报

发表于 2012-10-5 13:41 | 显示全部楼层
QQ截图20121005134032.jpg
一定要启用宏才行。
回复

使用道具 举报

发表于 2012-10-5 13:45 | 显示全部楼层
管理人员名单【到期】.rar (69.57 KB, 下载次数: 106)
回复

使用道具 举报

 楼主| 发表于 2012-10-5 13:45 | 显示全部楼层
hwc2ycy 发表于 2012-10-5 13:41
一定要启用宏才行。

不能打开excel自动运行么? 还有2011年的怎么不行?
回复

使用道具 举报

发表于 2012-10-5 13:46 | 显示全部楼层
你的要求是“合同还有15天到期自动提醒”
现在2012年了耶,
回复

使用道具 举报

 楼主| 发表于 2012-10-5 13:48 | 显示全部楼层
hwc2ycy 发表于 2012-10-5 13:46
你的要求是“合同还有15天到期自动提醒”
现在2012年了耶,

把还有15天将过期跟已过期都提示出来~!!要怎么弄!!谢谢了{:011:}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-4-16 19:15 , Processed in 0.362826 second(s), 12 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表