Sub inicia() ' Macro recorded 20/06/2016 by Jaime Aravena ' Keyboard Shortcut: Ctrl+i ActiveSheet.Range("D4:E32005").ClearContents End Sub Sub temper() ' Macro recorded 20/06/2016 by Jaime Aravena Lee valor desde web esp8266 ' Keyboard Shortcut: Ctrl+t ' Row = 4 ' fila de inicio de los datos leidos Final = ActiveSheet.Range("L2").Value + 4 'numero de datos a leer Retardo = ActiveSheet.Range("L1").Value 'retardo entre medidas (aprox) L: Range("A1").Select 'area donde esta el query On Error Resume Next Selection.QueryTable.Refresh BackgroundQuery:=False ActiveSheet.Range("D" & CStr(Row)).Value = Worksheets(1).Range("D1").Value ActiveSheet.Range("E" & CStr(Row)).Value = Worksheets(1).Range("E1").Value newHour = Hour(Now()) newMinute = Minute(Now()) newSecond = Second(Now()) + Retardo waitTime = TimeSerial(newHour, newMinute, newSecond) Application.Wait waitTime Row = Row + 1 If (Row < Final) Then GoTo L: End Sub