Copy Range D6:P6 in every 2 minutes And PASTE Values to Down Cells Continuesly in every 2 minutes

tkasiddique

New Member
Joined
Aug 26, 2019
Messages
4
Dear Sir,
Iam a small NSE Option Trader.
For Open Interest Tracker, i have designed a excell sheet Name OI Tracker.
In this sheet i get the updated Open Interest Values From D6:P6 (These Values get updated when the Open Interest data Updates in www.nse.com. So i need to get it copied the below cells in every 2 minutes (for doing analysis on market Trends).

For weeks and months i tried a lot of ways by watching you tube and all. But i couldnt get a correct solution.
So last only i reached this Group. so i hope from this board i have a solution for my probs.

expect a positive actions from the experts over here.
Thank you very much
 

tkasiddique

New Member
Joined
Aug 26, 2019
Messages
4
No sir. not used. Because iam not familiar with codes. i use excel copy paste only.
i used manual copy and past every time. i refresh first manually, when the value changes, i copy the row and past special manually down to next raw.
If you can help then will be great sir.
 

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,680
Hello,

You could test following

Code:
Option Explicit

Dim t As Date

Sub StartMacro()
    t = DateAdd("s", 120, Time)
    Application.OnTime t, "MyMacro"
End Sub

Sub MyMacro()
    Rows("7:7").Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
    Range("D7:P7").Value = Range("D6:P6").Value
End Sub

Sub StopMacro()
    Application.OnTime t, "MyMacro", False
End Sub
Hope this will help
 
Last edited:

tkasiddique

New Member
Joined
Aug 26, 2019
Messages
4
Sir, i checked today and its working.
it inserts new raw below d6 like that it come. But my requirment is that Copy D6:P6 should copy and paste Down wards like
fist paste at D7, then next Copy Paste to D8, Next to D9 like that it needed.
If it is not possible, then also iam happy with it.
Thank you for your great Support and actions.
Thanks alot Boss
 

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,680
Hello,

Below is your modification

Code:
Option Explicit

Dim t As Date

Sub StartMacro()
    t = DateAdd("s", 120, Time)
    Application.OnTime t, "MyMacro"
End Sub

Sub MyMacro()
Dim last As Long
    last = ActiveSheet.Cells(Rows.Count, "D").End(xlUp).Row + 1
    Range("D" & last & ":" & "P" & last).Value = Range("D6:P6").Value
End Sub


Sub StopMacro()
    Application.OnTime t, "MyMacro", False
End Sub
Hope this will help
 

tkasiddique

New Member
Joined
Aug 26, 2019
Messages
4
Sir,
Sorry for the delay. Due to work busy this delay happened.
Sir,
It is working as i wish.Copy and Past to the down ward.
But the problem is only 4 or 5 rows getting filled.
Then it is stopping.
If again i run macro, then it working again for some rows.
Iam doing run macro continuesly, and getting worked.
Thank you very much Sir
 

Forum statistics

Threads
1,085,294
Messages
5,382,769
Members
401,804
Latest member
RB85

Some videos you may like

This Week's Hot Topics

Top