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
Post a Comment