是德科技
直播中

曹皓轩

8年用户 186经验值
私信 关注
[问答]

Excel怎么从单元格获取数据

嗨,我有一个定义公式的单元格。
公式工作正常,我在这个单元格中看到“Y”。所以我想在我的VEE应用程序中得到这个“Y”。当试图检索(使用xLIB.DataFromCell)来自单元格的数据我得到公式(例如=
IF(A1 = 1,“Y”,“N”))。我如何获取数据?谢谢。

以上来自于谷歌翻译


     以下为原文

  Hi,

I have a cell where a formula is defined. Formula works fine and I see "Y" in this cell.
So I would like to get this "Y" in my VEE application.

When trying to retrieve(using xLIB.DataFromCell) a data from cell I am getting the formula(e.g =IF(A1=1,"Y","N")).
How I can get my data?

Thanks.  

回帖(4)

董英灏

2019-3-14 19:51:34
也许您可以尝试使用xlLib.EvalCellFormula而不是xLIB.DataFromCell。该对象位于Excel> GetData> Evalate Cell Data.Hope它适合您。

以上来自于谷歌翻译


     以下为原文

  Perhaps you can try to use xlLib.EvalCellFormula instead of xLIB.DataFromCell.
The object is located at Excel>GetData>Evalate Cell Data.
Hope it's work for you.
举报

曹皓轩

2019-3-14 19:58:10
我之前已经尝试过了。但是却得到了一些很大的负面价值。

以上来自于谷歌翻译


     以下为原文

  I have tried this already before.
but got some big negative value instead.
举报

董英灏

2019-3-14 20:03:48
我试图通过使用xlLib.EvalCellFormulait显示'Y'和'N'来检索= IF(A1 = 1,“Y”,“N”)的值,我没有看到任何负值。
:?
只有当我从一个消隐的单元格中执行'EvalCellFormula'时,我才得到一个非常大的数字。

以上来自于谷歌翻译


     以下为原文

  I have tried to retrieve value for =IF(A1=1,"Y","N") by using xlLib.EvalCellFormula
it show 'Y' and 'N', I did not see any negative value. :?

I get a very large -ve number only if i hv performed 'EvalCellFormula' from a blanked cell.

附件

举报

曹皓轩

2019-3-14 20:15:17
我有更复杂的公式,其中一些细胞来自另一张纸。我将再次尝试xlLib.EvalCellFormula。到目前为止,我已经通过将公式移动到VBA脚本解决了我的问题,所以我的目标细胞不再有公式,但结果
配方

以上来自于谷歌翻译


     以下为原文

  i have more complicated formula where some cells from another sheet are being involved.
i'll try out xlLib.EvalCellFormula again.

so far i have solved my issue by moving formula to VBA script so my target cells do not have formula anymore but the result of formula.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分