• fill column with days based 2 combobox

    Author
    Topic
    #467090

    Have a userform with a cmobobox named Months and a combobox named Years
    Combobox years is filled with a value: 2010,2011,…2020
    Combobox months is filled with all months
    I need when i select a month and a year automaticlly fille the column A of sheet with all day (format dd/mm/yyyy) based the selection year/month…
    How to.

    Viewing 0 reply threads
    Author
    Replies
    • #1211715

      Something like:

      Code:
      	Dim lngDay As Long, lngEnd As Long
      	lngEnd = Day(DateSerial(Me.Years, Me.Months + 1, 0))
      	Range("A1:A31").ClearContents
      	For lngDay = 1 To lngEnd
       	Cells(lngDay, "A").Value = DateSerial(Me.Years, Me.Months, lngDay)
      	Next lngDay
      
    Viewing 0 reply threads
    Reply To: fill column with days based 2 combobox

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: