Sep-15-2018, 10:55 PM
Thanks, I will have to try to keep everything simple, break things down into smaller steps. I had a problem with putting an 'if clause' in my calculate % scores routine. I could not get the indentation to work, so I put this before that step:
# avoid None values in any relevant cells for sheet in sourceSheetNames: sourceFileActiveSheet = sourceFile[sheet] maxCol = sourceFileActiveSheet.max_column maxRow = sourceFileActiveSheet.max_row for colNum in range(11, maxCol + 1, 3): for rowNum in range(4, maxRow +1): if sourceFileActiveSheet.cell(row=rowNum, column=colNum).value == None: sourceFileActiveSheet.cell(row=rowNum, column=colNum, value=0)This avoids any errors like this
Quote:Traceback (most recent call last):
File "./calculate%scores.py", line 98, in <module>
totalAttendance = totalAttendance + addScore
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'