For your first requirement, you would need to count how many times the
'state' of the cell changes.
something like:
Code:
--------------------
Select Case Current_State
Case "ON"
If New_State < Current_State then
Current_State = New_State
End IF
Case "OFF"
If New_State = "ON" then
On_Count = On_Count + 1
Current_State = New_State
End If
End Select
--------------------
Embed this in a loop that starts at row 7 down to the last line of your
spreadsheet.
As for your second request - I don't have the time at the mo - Sorry!
--
Rich_z
------------------------------------------------------------------------
Rich_z's Profile:
http://www.excelforum.com/member.php...o&userid=24737
View this thread:
http://www.excelforum.com/showthread...hreadid=386389