當前位置:編程學習大全網 - 電腦編程 - 用VBA統計滿足條件的數據的個數,求大神,

用VBA統計滿足條件的數據的個數,求大神,

Sub?mysub()

Dim?countA?As?Integer

Dim?countB?As?Integer

For?i?=?1?To?Range("B65536").End(xlUp).Row

If?Cells(i,?2).Value?=?[O2]?And?Cells(i?+?1,?2).Value?=?[O3]?Then

If?Cells(i?+?2,?"L").Value?=?"A"?Then

countA?=?countA?+?1

ElseIf?Cells(i?+?2,?"L").Value?=?"B"?Then

countB?=?countB?+?1

End?If

End?If

Next

[Q3]?=?countA

[R3]?=?countB

End?Sub

  • 上一篇:繡花機編程軟件
  • 下一篇:貝加萊plc壹直顯示出錯模式
  • copyright 2024編程學習大全網