Forum Discussion
Tony2021
Nov 09, 2021Steel Contributor
Formula for End of Current Year in VBA
Hello, I have a form and fills in fields based on which button I press. One of the buttons fills fields as below with current date and I am having an issue populating the field that is the end o...
- Nov 10, 2021PMFJI
Try DateSerial(Year(Date()),12,31)
Tony2021
Nov 09, 2021Steel Contributor
HI George, sorry about that. I read the question again and I agree I could have added more info. What I am looking for is a line of code that will return the last day of the year for Me.txtDateTo. The examples I provided did not work. the one that has DATE(YEAR(TODAY( in the code is a formula that works in excel but not VBA.
thank you. Let me know if its not clear.
thank you. Let me know if its not clear.
George_Hepworth
Nov 09, 2021Silver Contributor
Tony2021 "...The examples I provided did not work. "
Again, what does that mean? Errors? Wrong values? Describe the behavior, not the outcome. That's where we can spot clues to what might be wrong.