PDA

View Full Version : Solved: insert a date for the current year



av8tordude
05-25-2010, 09:12 PM
I'm importing a database into my workbook. I would like to insert 9/30/(current year) into Y11. I'm able to enter 9/30/10 with no problem, but a new database comes out every year. How do I write the code to enter 9/30 of the current year. Thanks. Below is the code I'm currently using



This_Sheet.Range("Y11") = "09/30/10"

GTO
05-25-2010, 09:31 PM
Try:
This_Sheet.Range("Y11") = DateSerial(Year(Date), 9, 30)

av8tordude
05-25-2010, 09:44 PM
Thank you GTO :friends: