macro's on weekdays.


Posted by Trevor Tinker on July 30, 2001 3:45 PM

Hi there,

Need a little help.

I have written some vba which clears data
on Excel sheets and re-writes them at specific
times of the day. Now, I need to run the clear
macro only on weekdays. Does anyone have an
easy way to do this.?

THanks in advance.

Trevor.

Posted by Malc on July 31, 2001 12:51 AM

Try using the networkdays formula either in the spreadsheet or in the macro (see help using worksheet functions in VBA). I don't recall any workday function in VBA but there might be something in the help. Anyway in desperation you could list the work days in the spreadsheet and then periodically check to see if Day(now()) is one of the days in the list.

Posted by Trevor Tinker on July 31, 2001 3:52 PM


Thanks for the reply Malc, I think you
are probably right, I was hoping not to
have to resort to cross-referencing with
a spreadsheet and do it all in VBA.
Anyway, I'll keep you posted.
Regs Trevor.



Posted by Ivan F Moala on July 31, 2001 7:50 PM

Have a look @ the WEEKDAY Function

Ivan