本文介绍了如何使用C#在工作表中创建公式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将Epplus库用于excel工作表.
现在我有了工作表,在工作表1中有列名称,标记等,其中学生的< 35标记是,我用红色填充该单元格.

我的要求是

1)在worksheet2中,我想要worksheet1的总行数(学生总数)
我想将worksheet1的公式创建为worksheet2.
我用过这个公式,

worksheet2.Cells [10,5] .Formula ="SUM(""+ worksheet1.name +"''."+ worksheet1.Cells [4,6].地址+":"+ worksheet1.Cells [rowIndex,6] .地址+)"

但在工作表2的cell [10,5]处给出了ERR:508.

2)红细胞计数,例如.
学生姓名:-xyz
标记:-70,34,34
所以这里2个单元格将是红色.
所以我想在worksheet2中计数红色单元格.

I have used Epplus library for excel worksheet.
Now i have work sheets , i have columns name,marks,etc in worksheet1 ,in that which student has <35 marks , i fill that cell with red colour.

My requirements are

1) in worksheet2 , i want total rows of worksheet1 (total student )
i want to create formula of worksheet1 into worksheet2.
i have used this formula ,

worksheet2.Cells[10, 5].Formula = "SUM(''" + worksheet1.name+ "''." + worksheet1.Cells[4, 6].Address + ":" + worksheet1.Cells[rowIndex, 6].Address + ")"

but its gives ERR:508 in worksheet2 at cell[10,5].

2) count of red cell , eg.
student name :- xyz
marks :- 70 , 34 , 34
so here 2 cell will be in red color.
so i want count of red cell in worksheet2.

is there any solution reply as soon as possible.

推荐答案




这篇关于如何使用C#在工作表中创建公式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-16 11:15