Read data present in a column in sequence

Luigi74

New Member
Joined
Nov 13, 2022
Messages
4
Office Version
  1. 2021
Platform
  1. Windows
Good morning all and thanks for your help.

I have this kind of problem:

I have a data in a Row "C" from line C4 to line C1500 in the Sheet "XXX" and I would like to read data, cell by cell. This reading must be done in the cell L30 every 5 seconds automatically.
I have this code that is working, but it runs too fast and I need it to be done slowly at list every 5 seconds .

Sub DATA_READ()

For MY_ROWS = 1 To Sheets("XXX").UsedRange.Rows.Count
Sheets("XXX").Range("L30").Value = Sheets("XXX").Range("C" & MY_ROWS).Value
'other code here
Next MY_ROWS
End Sub



regards,
Luigi
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hi, try the Wait method:
Application.Wait(Now + TimeValue("0:00:05"))
 
Upvote 0
Hi thank for you answer. Unfortunally it doen't work.
Hi, the timer is working but the problem of the "Application.Wait method" , is that it pause all the other macro also and the other macro they must be working all the time.

For MY_ROWS = 1 To Sheets("XXX").UsedRange.Rows.Count
Sheets("XXX").Range("L30").Value = Sheets("XXX").Range("C" & MY_ROWS).Value
Application.Wait(Now + TimeValue("0:00:05"))
Next MY_ROWS
End Sub

regards
 
Upvote 0
I have fourd this solution but it's a very long work to do for all the line I have.


Public Sub xxx()
Sheets("XXX").Range("L30").Value = Sheets("XXX").Range("C4").Value
Application.OnTime Now + TimeValue("00:00:02"), "xxx1"
End Sub

Public Sub xxx1()
Sheets("XXX").Range("L30").Value = Sheets("XXX").Range("C5").Value
Application.OnTime Now + TimeValue("00:00:02"), "xxx2"
End Sub

Public Sub xxx2()
Sheets("XXX").Range("L30").Value = Sheets("XXX").Range("C6").Value
Application.OnTime Now + TimeValue("00:00:02"), "xxx3"
End Sub

Public Sub xxx3()
Sheets("XXX").Range("L30").Value = Sheets("XXX").Range("C7").Value
Application.OnTime Now + TimeValue("00:00:02"), "xxx4"

End Sub
Public Sub xxx4()
Sheets("XXX").Range("L30").Value = Sheets("XXX").Range("C8").Value
Application.OnTime Now + TimeValue("00:00:02"), "xxx5"

End Sub
Public Sub xxx5()
Sheets("XXX").Range("L30").Value = Sheets("XXX").Range("C9").Value
'Application.OnTime Now + TimeValue("00:00:02"), "xxx6"

End Sub



.........AND SO ON
 
Upvote 0

Forum statistics

Threads
1,215,635
Messages
6,125,942
Members
449,275
Latest member
jacob_mcbride

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