how to pause the for loop

prakash_moturu

Board Regular
Joined
Nov 2, 2009
Messages
152
hi,
i wrote a code to get the 5 row and 5 column values by using the fallowing code.but i want to pause after one row is over then call next row after 15 seconds.

Private Sub CommandButton1_Click()
Dim val
For i = 1 To 5
For j = 1 To 5
val = Sheet1.Cells(i, j).Value

Next
Next

End Sub

where can i write the pause code after one row is over ?

please guide me.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Try like this

Code:
Private Sub CommandButton1_Click()
Dim val
For i = 1 To 5
    For j = 1 To 5
        val = Sheet1.Cells(i, j).Value
    Next
    Application.Wait Now + TimeSerial(0, 0, 15)
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,607
Messages
6,179,871
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top