LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Countdown 1 every workday

Hi Everyone.
I made this macro for fun, its based on a post last Sept.30.(Remove 1 from a
total after every day) answered by Ron Rosenfeld with a formula
(Networkdays).The post was on Answers.Microsoft.com
I do this for learning.I'm just at the learning stage.
I have a Date in A1 and a number in C1 that goes down by one everyday.
Now, my problem is, I want it just for Workdays..nor everydays.
I'm lost with this, can anyone help.

Option Explicit
Private Sub Workbook_Open()
Dim stdate As Date
Dim tday As Date
Dim ans As Integer
On Error GoTo Finish:
stdate = ActiveSheet.Range("A1")'Start Date
tday = Now()
ans = tday - stdate
If tday stdate Then
Range("F1") = Range("C1") + 1 - ans
If Range("F1").Value <= 0 Then
Range("F1").Interior.ColorIndex = 3
MsgBox "Your Time has expired"
Else
Range("F1").Interior.ColorIndex = 0
End If
End If
Finish:
End Sub

Regards
Cimjet

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set up countdown timer to countdown days to a specific day Jenny Excel Worksheet Functions 3 May 8th 23 07:43 PM
Add no. of days to a workday to get new workday? blswes Excel Worksheet Functions 1 April 15th 10 07:39 PM
Countdown chris miller Excel Discussion (Misc queries) 1 May 9th 08 10:36 AM
Countdown simserob Excel Worksheet Functions 0 July 21st 06 06:27 PM
Countdown simserob Excel Worksheet Functions 0 July 21st 06 06:26 PM


All times are GMT +1. The time now is 05:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"