local MyStartDate, CurrentGridColumnCount LastDayOfMonth = GoMonth(date(year(MyStartDate), month(MyStartDate), 1),1) - 1 For CurrentDay = MyStartDate to LastDayOfMonth If !InList(Dow(CurrentDay), 6, 7) CurrentGridColumnCount = CurrentGridColumnCount + 1 MyGrid.AddColumn(CurrentGridColumnCount) MyGrid.Columns(CurrentGridColumnCount).Header1.Caption = Transform(CurrentDay) * place here all your setting endif EndForI hope this also answers your previous question about number of days in a month.