hi there,

i am trying to make a webquery on a multiple page website to extract. I got some codings from mr Leith ross and tried to incorporate them with other declaration but I am getting a Syntax error. anyone please? I need help. thanks...
Sub getthem()

    Dim StartDate   As Variant
    Dim EndDate     As Variant
   
   Set ChangeDateWS = Worksheets("Sheet1")
   Set gather = Worksheets("Sheet4")
   
   StartDate = Format(ChangeDateWS.Range("B5").Value, "yyyy-mm-dd")
   EndDate = Format(ChangeDateWS.Range("B6").Value, "yyyy-mm-dd")
   
   With gather.QueryTables.Add(Connection:= _
      "URL;https://website.site.com/folder/processed_view.jsp?action=find&sdate=" & StartDate & "&edate=" & EndDate &start=0", _
         Destination:=Range("a1"))
   
      .BackgroundQuery = True
      .TablesOnlyFromHTML = True
      .Refresh BackgroundQuery:=False
      .SaveData = True
   End With
End Sub