Results 1 to 2 of 2
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts
    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
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

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