Community discussion forum

using calendar control and msflexgrid HELP!!!

Tags:
  • 7 months ago

    Hey, I'm not 100% sure what you want exactly. 

    If you want to select a date then loop back to Monday then fill the grid with Monday - Sundays date

    the code below should do it for you

        Dim tDate As Date
        tDate = Now     ' use todays date as example
        Do While Weekday(tDate) <> vbMonday
            tDate = DateAdd("d", -1, tDate)
        Loop
       
        Dim a As Integer
        For a = 1 To 7
            grdRota.TextMatrix(a, 1) = DateAdd("d", a - 1, tDate)
        Next a

     

Post a reply

Enter your message below

Sign in or Join us (it's free).