RE: Counting data
- From: Hassan <Hassan@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 12 Sep 2007 05:06:02 -0700
Hi Mike,
Have you received the link?
My hotmail address is hasan383@xxxxxxxxxxx, If it possible to give me help
on this?
"Mike H" wrote:
Post the file here and then post the link.
http://www.savefile.com/
"Hassan" wrote:
Hi Mike,
May I have your Email address on which i can send you the file then I think
its easy for you to understand what I try to say, because my english skill is
not high.
Thanks
"Mike H" wrote:
maybe this:-
Sub categorise()
Dim myRange As Range
myrow = 2
LastRow = Cells(Cells.Rows.Count, "B").End(xlUp).Row
Set myRange = Range("B2:B" & LastRow)
For Each c In myRange
Select Case c.Value
Case "Excess Idle"
ei = ei + 1
Case "Harsh Braking"
hb = hb + 1
Case "Speed"
s = s + 1
Case "Startup"
Range("H" & myrow).Value = "Excess idle " & ei
Range("I" & myrow).Value = "Harsh Braking " & hb
Range("J" & myrow).Value = "Speed " & s
ei = 0
hb = 0
s = 0
myrow = myrow + 1
End Select
Next
Range("B1:B" & LastRow).ClearContents
End Sub
Mike
"Hassan" wrote:
Hi Mike H,
Thanks for help and I am always saying to my friends that Mike H is giving
the answers of every difficult questions and macros, although my macro is not
difficult for you and I hope you will help me in this regards,
I want the count of Excess Idle in H2, Speed in I2 and Harsh Braking in J2,
and delete that rows which are counted and then go on next startup to start
up and so on.
"Mike H" wrote:
Hassan,
Try this macro. I have assumed B1 will always contain "Startup"
Right click the worksheet view code and paste in:-
Sub categorise()
Dim myRange As Range
LastRow = Cells(Cells.Rows.Count, "B").End(xlUp).Row
Set myRange = Range("B2:B" & LastRow)
For Each c In myRange
c.Select
Select Case c.Value
Case "Excess Idle"
ei = ei + 1
Case "Harsh Braking"
hb = hb + 1
Case "Speed"
s = s + 1
Case "Startup"
ActiveCell.Offset(-1, 1).Value = "Excell idle " & ei
ActiveCell.Offset(-1, 2).Value = "Harsh Braking " & hb
ActiveCell.Offset(-1, 3).Value = "Speed " & s
ei = 0
hb = 0
s = 0
End Select
Next
End Sub
Mike
"Hassan" wrote:
Hi All,
I am working in analysis company and I need help in this regard
B1 Startup
B2 Excess Idle
B3 Excess Idle
B4 Harsh Braking
B5 Speed
B6 Harsh Braking
B7 Speed
B8 Startup
B9 Harsh Braking
B10 Speed
B11 Speed
B12 Harsh Braking
B13 Excess Idle
B14 Ignition Off
I need that count of Excess Idle, Speed & Harsh Braking between startup to
startup, then count same startup to next startup and so on
Thanks & Regards
- References:
- RE: Counting data
- From: Hassan
- RE: Counting data
- From: Mike H
- RE: Counting data
- From: Hassan
- RE: Counting data
- From: Mike H
- RE: Counting data
- Prev by Date: RE: Counting data
- Next by Date: Referencing an add-in in VBA
- Previous by thread: RE: Counting data
- Next by thread: Re: Counting data
- Index(es):
Relevant Pages
|