Advertisement

Get stock data from an Exchange at specific intervals automatically

Get stock data from an Exchange at specific intervals automatically How to get stock data from an Exchange at specific intervals automatically using VBA.
Here's the complete VBA code:

Option Explicit

Dim myTimer As Date

Sub GetMyData()

Dim lastrow As Long, nextblankrow As Long

myTimer = Now + TimeValue("00:01:00")


Sheet1.Range("B2").Copy

lastrow = Sheets("Sheet1").Range("G" & Rows.count).End(xlUp).Row

nextblankrow = lastrow + 1

Range("G" & nextblankrow).PasteSpecial xlPasteValues

ActiveWorkbook.RefreshAll

Application.OnTime myTimer, "GetMyData"

End Sub

Sub StopGettingData()

Application.OnTime myTimer, "GetMyData", , False

MsgBox "Data Transfer Stopped!"

End Sub

Get stock data from an Exchange at specific intervals automatically,get stock data from an Exchange at specific intervals automatically using VBA,

Post a Comment

0 Comments