excel - Get Tuesday's date for current week using vba? -


i trying obtain current weeks date tuesday.

so instance today thursday 06.04.2017 tuesday of week 04.04.2017.

i trying using below:

dim iweekday integer iweekday = weekday(now(), vbtuesday) msgbox iweekday 

but returning monday's date 03.04.2017

please can show me going wrong?

you don't neeed use now() , date enough current date (without time).

try code below:

dim iweekday date  iweekday = date - weekday(date, vbtuesday) + 1 msgbox iweekday 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -