This is essentially what I need to code to do:
Here’s what I got so far:
Dim CurRow As Long, LastRow As Long, DestRow As Long
LastRow = Sheets("Tracker").Range("C" & Rows.Count).End(xlUp).Row
For CurRow = 1 To LastRow
If Sheets("Tracker").Range("C" & CurRow).Value = "Waiting" Then
DestRow = Sheets("X").Range("A" & Rows.Count).End(xlUp).Row + 1
With Worksheets("X").QueryTables.Add(Connection:= _
"URL;http://efm/telecom/engineeringWorkOrders/viewEWOStatusLog.aspx?ewonumber=" & Sheets("Tracker").Range("A" & CurRow).Value _
, Destination:=Worksheets("X").Range("A1"))
' Details of Query have been omitted for simplicy sake
End With
End If
If Sheets("Tracker").Range("AW" & CurRow).Value > Sheets("X").Range("B1").Value Then
Sheets("Tracker").Range("AV" & CurRow).Value = "Check!"
End If
With Sheets("X")
.Rows(1 & ":" & .Rows.Count).DELETE
End With
Next CurRow
End Sub
The problem I’m having is that step 4 and 5 is not working!
- Clear Sheet X
- Find the first / next “Waiting” text in column 3 of the “Tracker” sheet
- Create a Query on Sheet X (in cell A1) with the address “http://efm/telecom/engineeringWorkOrders/viewEWOStatusLog.aspx?ewonumber=” + the corresponding # in column 1 of the same row (as the matching “waiting” text in step 2)
- Check if the date in cell B1 of Sheet X is >= date in column 49 (of the corresponding row) on “Tracker” Sheet.
- If the date is >= then write “Check!” in column 48 of the “Tracker” sheet of the corresponding row
- Repeat the loop until the last “Waiting” has been found in column 3 of the “Tracker” sheet (Step 2)
Here’s what I got so far:
Dim CurRow As Long, LastRow As Long, DestRow As Long
LastRow = Sheets("Tracker").Range("C" & Rows.Count).End(xlUp).Row
For CurRow = 1 To LastRow
If Sheets("Tracker").Range("C" & CurRow).Value = "Waiting" Then
DestRow = Sheets("X").Range("A" & Rows.Count).End(xlUp).Row + 1
With Worksheets("X").QueryTables.Add(Connection:= _
"URL;http://efm/telecom/engineeringWorkOrders/viewEWOStatusLog.aspx?ewonumber=" & Sheets("Tracker").Range("A" & CurRow).Value _
, Destination:=Worksheets("X").Range("A1"))
' Details of Query have been omitted for simplicy sake
End With
End If
If Sheets("Tracker").Range("AW" & CurRow).Value > Sheets("X").Range("B1").Value Then
Sheets("Tracker").Range("AV" & CurRow).Value = "Check!"
End If
With Sheets("X")
.Rows(1 & ":" & .Rows.Count).DELETE
End With
Next CurRow
End Sub
The problem I’m having is that step 4 and 5 is not working!