如何用EXCEL做倒计时
的有关信息介绍如下:1.A1 输入 2008-8-8 8:8:8 B1 输入 =NOW() 这是现在的时间实时变化的 可以不要这列 C1 输入 =B1-A1 D1 输入: =INT(C1)&"天"&TEXT(C1-INT(C1),"h时m分s秒") D1 便是倒计时 这是详细的分解了计算过程 你可以直接在 A1 输入 2008-8-8 8:8:8 B1 输入=INT(NOW()-A1)&"天"&TEXT(NOW()-A1-INT(NOW()-A1),"h时m分s秒") 就ok了 这样你每次打开文档都会更新时间 应为now()就是取现在的时间 注意:a1你要输入日期数据而不是你的那种 200,150 的 你说清单位的话可以转换整列的话你只要向下托动单元格就可以了2.比方说你要设定一个到10:30的倒计时,用这个公式:=TIMEVALUE("10:30:00")-TIMEVALUE(HOUR(NOW())&":"&MINUTE(NOW())&":"&SECOND(NOW()))当然你还要把单元格格式设置为时间格式。3.VBA做的窗体上放一个label,一个HScrollbox,三个Commandbutton,一个timer双击窗体,删掉别的代码,粘贴下面代码:Dim Minute, Second As LongPrivate Sub Command1_Click()Minute = InputBox("输入分钟数", "倒计时时间")Second = 60 * MinuteLabel1.Caption = "倒计时时间为" & Minute & "分钟"Command2.Enabled = TrueCommand3.Enabled = TrueEnd SubPrivate Sub Command2_Click()Timer1.Interval = 1000Timer1.Enabled = TrueEnd SubPrivate Sub Command3_Click()Timer1.Enabled = FalseLabel1.Caption = "已结束倒计时"End SubPrivate Sub Form_Load()Timer1.Enabled = FalseCommand2.Enabled = FalseCommand3.Enabled = FalseEnd SubPrivate Sub Timer1_Timer()If Second < 0 ThenTimer1.Enabled = FalseElseLabel1.Caption = IIf(Second \ 3600 = 0, "00", IIf(Second \ 3600 < 10, "0" & Second \ 3600, Second \ 3600)) & ":" & IIf(Second \ 60 Mod 60 = 0, "00", IIf(Second \ 60 Mod 60 < 10, "0" & Second \ 60 Mod 60, Second \ 60 Mod 60)) & ":" & IIf(Second Mod 60 Mod 60 = 0, "00", IIf(Second Mod 60 Mod 60 < 10, "0" & Second Mod 60 Mod 60, Second Mod 60 Mod 60))HScroll1.Value = (60 * Minute - Second) / (60 * Minute) * HScroll1.MaxSecond = Second - 1End IfEnd Sub