コード例 #1
0
ファイル: ThisAddIn.cs プロジェクト: Spookspear/c-
        // repairs sums at bottom of cols A->M then S:
        public void repairTimeRecording(Excel.Worksheet Wks, decimal intRowStart, decimal intRowEnd)
        {
            decimal intCol_Start = CommonExcelClasses.getExcelColumnNumber("A");
            decimal intCol_End   = CommonExcelClasses.getExcelColumnNumber("M");

            // string strDeltaCol, strDeltaRange, strSumString;
            string  strDeltaCol;
            string  strSumString;
            decimal intDeltaA;

            for (intDeltaA = intCol_Start; intDeltaA <= intCol_End; intDeltaA++)
            {
                strDeltaCol = CommonExcelClasses.getExcelColumnLetter((int)intDeltaA);

                strSumString = CommonExcelClasses.createFormula(strDeltaCol, intRowStart, intRowEnd);

                Wks.Cells[intRowEnd + 1, intDeltaA].Value = strSumString;
            }

            // ' finally do S
            intDeltaA   = 19;
            strDeltaCol = CommonExcelClasses.getExcelColumnLetter((int)intDeltaA);

            strSumString = CommonExcelClasses.createFormula("S", intRowStart, intRowEnd);
            Wks.Cells[intRowEnd + 1, intDeltaA].Value = strSumString;
        }