DatePart("w", varDateVariable, vbSaturday) returns a number corresponding to
the day of the week. By specifying vbSaturday as the 3rd argument, it will
return 1 for Saturdays, 2 for Sundays, 3 for Mondays and so on up to 7 for
Fridays.
By subtracting that value from 7, therefore, you know how many days it is
until the next Friday, so you add that many days to your date.
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.