应用公式而不复制或拖动 [英] Applying formula without copying or dragging

查看:65
本文介绍了应用公式而不复制或拖动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我在VS 2010中有我的excel项目.我做了一个Excel加载项.在dll中具有UDF.它的工作正常.由于我试图从数据库中获取数据并在每个单元格中复制公式,因此在Excel中填充结果需要一些时间.我想增加它的响应时间,以便让我转瞬即逝.

如果只在一个单元格中复制公式,然后如果给定范围,只要我引用相同的单元格,我就会以某种方式思考,这样我就可以摆脱耗时的问题.

例如我拥有的是

Dear All,

I have my excel project in VS 2010. I have made an Excel Add-In. Which has an UDF in dll. Its working fine. Since I am trying to fetch data from database and copying my formula in each cell, Its taking some time to populate the result in excel. I want to increase its response time so that it can give me result in a blink of an eye.

What I think is somehow if I copied the formula in just one cell and then for a given range if i just refer the same cell, then i can get rid of time consuming issue.

e.g. what i have is

DEMO              2-Apr-10              3-Apr-10                 4-Apr-10        
abc      myFunction("p1,p2,p3")  myFunction("p1,p2,p3")  myFunction("p1,p2,p3")  
pqr      myFunction("p1,p2,p3")  myFunction("p1,p2,p3")  myFunction("p1,p2,p3")  
xyz      myFunction("p1,p2,p3")  myFunction("p1,p2,p3")  myFunction("p1,p2,p3")  
lmn      myFunction("p1,p2,p3")  myFunction("p1,p2,p3")  myFunction("p1,p2,p3")  



执行完每个函数后,将为相应的单元格返回适当的值.我使用了绝对单元格功能,即使用"$"来实现上述输出.
我认为这是造成性能不佳的原因,因为每个单元功能都在影响我的数据库.我有Server2008.



这就是我想要的..
例如



after execution of each function returns appropriate value for corresponding cell. I have used absolute cell features i.e. with "$" to achieve above output.
I think this is responsible for poor performance because for each cell function is hitting my database. I have Server 2008.



This is what I want..
e.g.

myFunction("p1,p2,p3")  2-Apr-10    3-Apr-10    4-Apr-10        
abc                      value1      value2      value3
pqr                      value4      value5      value6
xyz                      value7      value8      value9
lmn                      value10     value11     value12




写在最左上角单元格中的函数应该能够填充其余的excel.

我已经尝试了很多东西,但是我擅长的知识不足以破解这个问题.我也创建了一些宏,但没有成功.

在此方面的任何帮助都是非常可观的.

谢谢..




The function written in the top most left cell should be able to populate the rest of excel.

I have tried lots of things but my excel knowledge is not enough to crack this. I have created some macros also but not succeeded.

Any help on this is highly appreciable.

Thanks..

推荐答案

实现上述输出.
我认为这是造成性能不佳的原因,因为每个单元功能都在影响我的数据库.我有Server2008.



这就是我想要的..
例如
" to achieve above output.
I think this is responsible for poor performance because for each cell function is hitting my database. I have Server 2008.



This is what I want..
e.g.
myFunction("p1,p2,p3")  2-Apr-10    3-Apr-10    4-Apr-10        
abc                      value1      value2      value3
pqr                      value4      value5      value6
xyz                      value7      value8      value9
lmn                      value10     value11     value12




写在最左上角单元格中的函数应该能够填充其余的excel.

我已经尝试了很多东西,但是我擅长的知识不足以破解这个问题.我也创建了一些宏,但没有成功.

在此方面的任何帮助都是非常可观的.

谢谢..




The function written in the top most left cell should be able to populate the rest of excel.

I have tried lots of things but my excel knowledge is not enough to crack this. I have created some macros also but not succeeded.

Any help on this is highly appreciable.

Thanks..


我的评论仍在最新状态...

请阅读以下文章:
1) Range.Formula属性 [ ^ ]
2)如何从Microsoft Visual C#.NET自动化Microsoft Excel [
My comment is still current...

Please, read the following articles:
1) Range.Formula Property[^]
2) How to automate Microsoft Excel from Microsoft Visual C#.NET[^]
and, if it still would be necessary, improve your question.


这篇关于应用公式而不复制或拖动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆