Sub WhichQueiries()
Dim qr As WorkbookQuery
Dim Rw as Long
Rw = 1
Sheets.Add Name = "Query Names"
With Sheets("Query Names")
For Each qr In ThisWorkbook.Queries
Rw = Rw + 1
.Cells(Rw, 1) = qr.Name
.Cells(Rw, 2) = qr.Parent
.Cells(Rw, 3) = qr.Formula
.Cells(Rw, 4) = qr.Description
Next
End With
End Sub
You should be able to delete Queries by Name: ThisWorkbook.Queries("Name").Delete
You should also be able to use any property with an If...Then:
If qr.Formula = "let Source = Blah, Blah, Blah" Then
qr.Delete
End If