Date entry using a macro

D

disco

Hey guys,

Have searched the forum and cant find the answer to this one!

I am trying to enter in a date in a cell using a macro; the date needs to be
3 working days before todays date. I thought i could utilise the NETWORKDAYS
function, but cant seem to do it.

Thanks in advance

Dan
 
B

Bob Phillips

=WORKDAY(TODAY(),-3)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
F

Frank Stone

hi
try this:
Sub maccount3()
Dim c As Variant
Dim ctr As Integer
c = Date
ctr = 3
Do While ctr >= 1
If Weekday(c) = 1 Then
c = c - 2
Else
ctr = ctr - 1
c = c - 1
End If
Loop
MsgBox "3 Days from now(not counting weekends) is " & c
c.Value = Range("mycell").Value
End Sub
 
B

Bob Phillips

Yes it is, it is part of the Analysis Toolpak, just like Networkdays

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top