如何优化这个简单而可怕的实现? [英] How to optimize this simple but horrible implementation?

查看:119
本文介绍了如何优化这个简单而可怕的实现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我基本上要为从细胞中移除公式,但要保留的计算值。

所以,我实现了它很容易和它的伟大工程,但很慢。(约2分钟,1800个细胞)

SO, I implemented it easily and it works great but REALLY SLOW. (About 2 mins for 1800 cells)

我有:

Dim col As Excel.Range = getRange()
For Each cell In col
    cell.Value = cell.Value
Next

我试图这样做是为了在第一单元格,然后自动填充的其余部分,但复制第一单元格的值与细胞的列中的其余部分。

I tried to do this to the first cell and then autofill the rest, but that copied the value of 1st cell to the rest of the cells in column.

那么,我应该怎么做,使之快。

So, what shall I do to make it fast..

我觉得一定有什么相关的自动填充,应该做的伎俩。

请帮助!

推荐答案

如果您知道您的范围的确切地址,或者你可以把它(也许用getRange()?),这似乎为我工作到从细胞中除去一个公式,同时保持结果

If you happen to know the exact address of your range, or you can get it (maybe using getRange()?), this seemed to work for me to remove a formula from the cells while maintaining the result:

Worksheets("Sheet1").Range("A1:F15").Value = Worksheets("Sheet1").Range("A1:F15").Value

这篇关于如何优化这个简单而可怕的实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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