Help with dates

  • Thread starter Thread starter Greg B...
  • Start date Start date
G

Greg B...

Hi all

I am wondering if there is a code that I can put in to automatically place
in a cell the date of the previous Tuesday. i.e. 22 feb was the last
tuesday.

Thanks in advance

Greg
 
This worksheet formula will calculate the previous tuesday:
=TODAY()-CHOOSE(WEEKDAY(TODAY(),1),5,6,7,1,2,3,4)
If you need to convert to a value instead of the formula, you can create
code to calculate this and then store the value in the cell:
Range(DateCell).Value = Date() - Choose(Weekday(Date()),5,6,7,1,2,3,4)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top