Hi all, I was given this answer by Tony H to my question about recording the contents of a cell which is linked to an IP address every 15 minutes into a column and it works. I would now like to record 12 different IP addresses into columns for Temperature and Humidity of Data halls but I'm stuck. Can anyone help please.
Code:
Sub GetData()
Dim rng As Range
Dim i As Long
Dim dte As Date
Dim dteNext As Date
dte = Now
Set rng = activesheet.Range("E1")
For i = 1 To 3 'change this to number of time to loop
ThisWorkbook.RefreshAll
DoEvents
Set rng = rng.Offset(1)
rng = Now
rng.Offset(, 1) = activesheet.Range("B3")
dteNext = dte + TimeSerial(Hour:=0, Minute:=1 * i, Second:=0) 'change this value to number of minutes
Application.Wait dteNext
Next
MsgBox "done"
End Sub
Code:
Bookmarks