View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein \(MVP - VB\)[_477_] Rick Rothstein \(MVP - VB\)[_477_] is offline
external usenet poster
 
Posts: 1
Default NUMBERS RUN IN ONE CELL

But why what?...

Why did I post my formula? I thought readers of this thread (whether in this
newsgroup or in the Google archives) would be interested in seeing the
equivalence between the longer (direct) method that you posted and the
shorter (Mod function call) method that I posted.

Why is your code marginally quicker? It takes longer to execute a Mod
function than an If-Then test.

Some other why?

Rick


"Bob Phillips" wrote in message
...
But why?

--
---
HTH

Bob


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



"Rick Rothstein (MVP - VB)" wrote in
message ...
Just as a point of interest, these four lines from your code....

cnt = cnt + 1
If cnt 100000 Then
cnt = 0
End If

can be replaced by this single line...

cnt = (cnt + 1) Mod 100001

Although I would note your code is marginally quicker than what I posted.

Rick


"Bob Phillips" wrote in message
...
Sub CountDown()
Static cnt As Long

Range("A1").Value = cnt
cnt = cnt + 1
If cnt 100000 Then

cnt = 0
End If

Application.OnTime Now + TimeSerial(0, 0, 1), "CountDown"

End Sub


--
---
HTH

Bob


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



"SANDIND" wrote in message
...
Is there anyway by which i can make one cell to continously show
numbers
running from 0 to 100,000 and then again start from 0.

I have sheet where I refresh the external data and by the time data is
refreshed I want one of the cells to show the pattern of running
numbers.