As Paul alluded to, put the following line after the "bedrag = Range("B4")" line
datedoc = Format(Date, "yyyy-mm-dd")