**** to display formulae (totals at the bottom of the excel report) Col02=3 lcASCIIcode=65+2 && 65 for chr(65)="A" + 2 = chr(67)= "C" where i want to start placing the formula SELECT &lcFile2 GO top DO WHILE .T. .and. .not. EOF() .Cells(row01,Col02).Borders(4).LineStyle = 1 .Cells(row01+1,Col02).Value = Tgldebit .Cells(row01+1,Col02).Borders(4).LineStyle = 9 DO WHILE .T. DO case CASE Col02<=26 .Cells(row01+3,Col02).formula = "=SUM("+CHR(lcASCIIcode)+LTRIM(str(7))+":"+CHR(lcASCIIcode)+LTRIM(str(row01))+")" .Cells(row01+3,Col02).Borders(4).LineStyle = 9 Col02=Col02+2 lcASCIIcode = lcASCIIcode + 2 IF lcASCIIcode>90 lcASCIIcode = 65 ENDIF EXIT CASE Col02>=27 .and. Col02<=51 .Cells(row01+3,Col02).formula = "=SUM(A"+CHR(lcASCIIcode)+LTRIM(str(7))+":A"+CHR(lcASCIIcode)+LTRIM(str(row01))+")" .Cells(row01+3,Col02).Borders(4).LineStyle = 9 Col02=Col02+2 lcASCIIcode = lcASCIIcode + 2 IF lcASCIIcode>90 lcASCIIcode = 65 ENDIF EXIT CASE Col02>=52 .and. Col02<=77 .Cells(row01+3,Col02).formula = "=SUM(B"+CHR(lcASCIIcode)+LTRIM(str(7))+":B"+CHR(lcASCIIcode)+LTRIM(str(row01))+")" .Cells(row01+3,Col02).Borders(4).LineStyle = 9 Col02=Col02+2 lcASCIIcode = lcASCIIcode + 2 IF lcASCIIcode>90 lcASCIIcode = 65 ENDIF EXIT CASE Col02>=78 .and. Col02<=103 .Cells(row01+3,Col02).formula = "=SUM(C"+CHR(lcASCIIcode)+LTRIM(str(7))+":C"+CHR(lcASCIIcode)+LTRIM(str(row01))+")" .Cells(row01+3,Col02).Borders(4).LineStyle = 9 Col02=Col02+2 lcASCIIcode = lcASCIIcode + 2 IF lcASCIIcode>90 lcASCIIcode = 65 ENDIF EXIT CASE Col02>=104 .and. Col02<=129 .Cells(row01+3,Col02).formula = "=SUM(D"+CHR(lcASCIIcode)+LTRIM(str(7))+":D"+CHR(lcASCIIcode)+LTRIM(str(row01))+")" .Cells(row01+3,Col02).Borders(4).LineStyle = 9 Col02=Col02+2 lcASCIIcode = lcASCIIcode + 2 IF lcASCIIcode>90 lcASCIIcode = 65 ENDIF EXIT CASE Col02>=130 .and. Col02<=156 .Cells(row01+3,Col02).formula = "=SUM(E"+CHR(lcASCIIcode)+LTRIM(str(7))+":E"+CHR(lcASCIIcode)+LTRIM(str(row01))+")" .Cells(row01+3,Col02).Borders(4).LineStyle = 9 Col02=Col02+2 lcASCIIcode = lcASCIIcode + 2 IF lcASCIIcode>90 lcASCIIcode = 65 ENDIF EXIT ENDCASE ENDDO skip ENDDO