In order to fit my code, I needed to convert today's year to a two digit number (the last two digits). To test this, I tried:
Sub test()
Dim y As String
y = Format(Year(Now), "00")
MsgBox (y)
End Sub
I was told by a classmate that I could use the "Mid" function, but I'm not very familiar with VBA; any help?
Dfor day,Mfor month andYfor year. The number of letters you use determines how it comes out. SoYYwill give you21whereasYYYYwill give you2021. Another example for a full date:"DD-MM-YYwill give24-01-21whereas"DD-MMM-YYYY"will give24-Jan-2021. Also instead ofYear(Now), either useDateorNow()