Consulting

Results 1 to 3 of 3

Thread: Solved: insert a date for the current year

  1. #1

    Solved: insert a date for the current year

    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"

  2. #2
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Try:
    [vba] This_Sheet.Range("Y11") = DateSerial(Year(Date), 9, 30)
    [/vba]

  3. #3
    Thank you GTO

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •