         
         var staffstring = ""
         
-        for(var i = 0; i < DBmethod().StaffNumberGet(); i++){
+        for i in 0 ..< DBmethod().StaffNumberGet(){
             let nowstaff = staffcellpositionarray[i]
             let replaceday = nowstaff.stringByReplacingOccurrencesOfString("F", withString: cellrow[day])
             

                shiftdb.month = 0
                
                shiftdetaildb.id = shiftdetailrecordcount
                shiftdetailrecordcount++
                shiftdetaildb.day = date

                switch(flag){
                case 0:         //11日〜30(31)日までの場合
                    shiftdetaildb.year = CommonMethod().JudgeYearAndMonth(worksheet.P1).startcoursmonthyear
                    shiftdetaildb.month = CommonMethod().JudgeYearAndMonth(worksheet.P1).startcoursmonth
                    date++
                    
                    if(date > monthrange.length){
                        date = 1

//        let monthrange = c.rangeOfUnit([NSCalendarUnit.Day],  inUnit: [NSCalendarUnit.Month], forDate: shiftnsdate)
        let staffcellposition = self.StaffCellPositionGet()     //スタッフの名前が記載されているセル場所 ex.)F8,F9

        for i in 0 ..< monthrange.length{
            self.TheDayStaffAttendance(i, staffcellpositionarray: staffcellposition, worksheet: worksheet.sheet)
        }
    }
