PDA

View Full Version : Solved: Insert year into cell



av8tordude
04-28-2011, 11:28 AM
I have this code that inserts the date into cell T8. Can someone assist with editing the code below that will extract the selected year from the listbox and insert 09/30 & selected year (leaving off "FY") into cell T8?


Example: If FY2010 is selected, 09/30/2010 should be inserted into cell T8.



The current code I'm using is...


This_Sheet.Range("T8").Value = Format(CDate("30-Sep-" & Year(Date)), "mm/dd/yyyy")



I want to replace Year(Date) with the year selected from the listbox.


Thanks for your help.

Bob Phillips
04-28-2011, 12:05 PM
This_Sheet.Range("T8").Value = "30/09/" & Right(Listbox1.Value, 4)

av8tordude
04-28-2011, 12:20 PM
Works perfect XLD! Thank you!:friends::beerchug: