>
> Dim Seconds As  Long 
> Dim Minutes As  Long 
> Dim CurrentRow As  Long 
> Dim CurrentColumn As  Long 
> Dim Initalised As Boolean 
>  
> Private Sub Recalc() 
>     If (CurrentRow <> 0 And CurrentColumn <> 0) Then 
>         Cells(CurrentRow, CurrentColumn).Value = Format(Now, "dd/mm/yy") 
>         Cells(CurrentRow, CurrentColumn+1).Value = Format(Time, "hh:mm:ss 
> AM/PM") 
>          
>         Seconds = Seconds + 1 
>          
>         If (Seconds = 60) Then
>     Randomize
>     Cells(currentrow, currentcolumn+2).value= rnd*7
>     Randomize
>     Cells(currentrow, currentcolumn+3).value= (rnd*7)+1
>     Randomize
>     Cells(currentrow, currentcolumn+4).value= (rnd*7)+2 
>         Minutes = Minutes + 1 
>         CurrentRow = CurrentRow + 1 
>         Seconds = 0 
>      
>
>         End If 
>          
>          ' Stop repeating after 24 hours (1440 minutes)
>         If (Minutes < 1440) Then 
>             Call SetTime 
>         Else 
>             Initalised = False 
>         End If 
>     End If 
> End Sub 
>  
> Sub SetTime() 
>     If (Not Initalised) Then 
>         Initalised = True 
>          
>          ' Initialise variables.
>         Seconds = 0 
>         Minutes = 0 
>         CurrentRow = ActiveCell.Row 
>         CurrentColumn = ActiveCell.Column 
>     End If 
>      
>     SchedRecalc = Now + TimeValue("00:00:01") 
>     Application.OnTime SchedRecalc, "Recalc" 
> End Sub 
>
>
>
>
>
>
> The requirement supposed to be Cell C1 should be a randomized number 
> between 0 and 7. Cell D1 should show a randomized number between (greater 
> than the value in Cell C1) and 8. Cell E1 should show a randomized number 
> between (greater than the value in the Cell D1) and 9. This way it will not 
> show any repeated numbers in any of the cells. All numbers should show as 
> whole numbers and this continue all the way to Cells C1440, D1440 and E1440 
> where Cells C1440,D1440 and E1440 should not repeated(same) numbers.
>
> The current VBA programme once a while is actually showing repeated 
> numbers in Cells C1,D1and E1.
>
    
   Thanks.



-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at https://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.

Reply via email to