Excel实时数据计数器(DDE服务器) [英] Excel live data counter (DDE Server)

查看:81
本文介绍了Excel实时数据计数器(DDE服务器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用DDE服务器在excel上的两列上导入实时数据,数据每秒都在变化.

I'm using DDE server to import live data on excel on two columns, the data changes every second.

我当前正在做的是我在单元格A1上有实时数据,在单元格B1上有实时数据在单元格C1上,我具有以下公式

What im currently doing is i have live data on Cell A1 and live data on Cell B1 on Cell C1 i have the following formula

=A1=B1

假设哪个为真,但有时结果为假(因为单元格A1与单元格B1不匹配)

Which is suppose to be true, but sometimes the result is false (as cell A1 doesn't match cell B1)

我想计算C1中的结果为假"的次数

I want to calculate how many times "false" is the result in C1

我的问题是它的实时数据和几乎每秒钟更改一次,并且我的结果应该累加.有没有人对如何在excel上有任何建议?

My problem is its a live data and changes almost every second, and my result should be accumulated. Does anyone have any suggestion on how can it be done on excel?

谢谢

推荐答案

尝试一下:

Private Sub Worksheet_Calculate()

Dim Count As Long
Dim KeyCells As Range

Set KeyCells = Range("C1")

Count = 0

If IsEmpty(Range("D1").Value) = False Then
    Count = Range("D1").Value
End If


    If KeyCells.Value = False Then
        Count = Count + 1
        Range("D1").Value = Count
    End If

End Sub

注意::这里D1单元格将 保存 ,如果需要,请更改单元格...此代码将计算多少时间返回"False".

Note : Here D1 Cells will Save the counted value, Change the cells if needed ... This code will count how much time "False" are returned ..

向tim申请worksheet_calculate()

Credit to tim for worksheet_calculate()

这篇关于Excel实时数据计数器(DDE服务器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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