Set userform Listbox to read correct Date format

  • I have a userform with listbox,I want to use option buttons to fill the listbox with the date format of worksheet2. Not sure if possible but I want to pick a date from listbox and have the
    data in the data fill box paste to that date on sheet2? If I want the event 20 times it will paste it 20 time only,like a birthday on 7/24. Be able to repeat that event for next 20 years.



    Thanks Z

  • Re: Set userform Listbox to read correct Date format


    I don't understand the rest.


    To populate the dates as formated in sheet2

    Code
    Private Sub UserForm_Initialize()
        ListBox1.List = Sheet2.Evaluate("index(text(d2:d2500,""" & Sheet2.[d2].NumberFormat & """),)")
    End Sub
  • Re: Set userform Listbox to read correct Date format


    Thanks jindon
    thats works, was hoping to select option button yearly to fill the listbox with column D, select optionbutton monthly to fill the listbox with column E. This is just part of a project I'm trying to do. I want to pick a date from
    listbox and have the date in the data fill box paste it to column C next to the right date. If it was a birthday it would paste all the dates with 7/15 for the number of times in the spinbutton box


    Z

  • Re: Set userform Listbox to read correct Date format


  • Re: Set userform Listbox to read correct Date format


    Now is the Hard part,is it going to be possible to select a date in the listbox,have Text in the Data Fill box (Good Morning) and paste that text in column C on proper Date?. Not
    sure this can be done let alone have it paste by the number of times in the Event Times Box. Does anyone know if this is possible. For Example you have a 2 year loan and payment is due on the 25-Jul,you
    would set the event times to 24 and paste it 24


    Z

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!