ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Stopwatch from Excel (https://www.excelbanter.com/excel-programming/384258-stopwatch-excel.html)

DTM[_5_]

Stopwatch from Excel
 

I am trying to record the amount of time over the course of a day that
an excel formula is returning a given result e.g. "true" or "false"
My attempts at coding this in vb have proved very clunky, can anyone
think of a solution or know of a suitable programme that can be called
from excel?

TIA


joel

Stopwatch from Excel
 
A worksheet change function

Private Sub Worksheet_Change(ByVal Target As Range)

If StrComp(StrConv(Target, vbUpperCase), "TRUE") = 0 Then
Worksheets("sheet1").Range("A1") = Worksheets("sheet1").Range("A1") + 1
End If
If StrComp(StrConv(Target, vbUpperCase), "FALSE") = 0 Then
Worksheets("sheet1").Range("A2") = Worksheets("sheet1").Range("A2") + 1
End If
End Sub


"DTM" wrote:


I am trying to record the amount of time over the course of a day that
an excel formula is returning a given result e.g. "true" or "false"
My attempts at coding this in vb have proved very clunky, can anyone
think of a solution or know of a suitable programme that can be called
from excel?

TIA



Bob Phillips

Stopwatch from Excel
 
You can simplify

If StrComp(StrConv(Target, vbUpperCase), "TRUE") = 0 Then

to

If Target.Value Then

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Joel" wrote in message
...
A worksheet change function

Private Sub Worksheet_Change(ByVal Target As Range)

If StrComp(StrConv(Target, vbUpperCase), "TRUE") = 0 Then
Worksheets("sheet1").Range("A1") = Worksheets("sheet1").Range("A1") +
1
End If
If StrComp(StrConv(Target, vbUpperCase), "FALSE") = 0 Then
Worksheets("sheet1").Range("A2") = Worksheets("sheet1").Range("A2") +
1
End If
End Sub


"DTM" wrote:


I am trying to record the amount of time over the course of a day that
an excel formula is returning a given result e.g. "true" or "false"
My attempts at coding this in vb have proved very clunky, can anyone
think of a solution or know of a suitable programme that can be called
from excel?

TIA






All times are GMT +1. The time now is 09:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com