当细胞配方改变时,如何获得先前的公式? [英] How to get previous formula when a cell formula changes?

查看:75
本文介绍了当细胞配方改变时,如何获得先前的公式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用worksheet_change记录(数字)单元格值更改。  但是,当公式发生变化时,有没有办法确定单元格的先前公式?  



ajw

I'm using worksheet_change to log (numeric) cell value changes.   However, is there a way to determine the previous formula for a cell when the formula changes?  


ajw

推荐答案

Re:获取上一个公式



要从单元格中获取上一个公式,您必须在更改之前记录/保存该公式


无论你做什么来记录/保存单元格值都可能适用于公式...

  x =工作表("污泥")。范围("B10")。公式

  MyArray(2,10)= x



Re: get previous formula

To get the previous formula from a cell, you have to log/save that formula before it is changed.
Whatever you are doing to log/save cell values would probably work for formulas...
  x = Worksheets("sludge").Range("B10").Formula
  MyArray(2, 10) = x

'--- $
Jim Cone

美国俄勒冈州波特兰市
https://goo.gl/IUQUN2  (Dropbox)
'---
Jim Cone
Portland, Oregon USA
https://goo.gl/IUQUN2 (Dropbox)


这篇关于当细胞配方改变时,如何获得先前的公式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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