We queries can be run using VBA code by looping through the cell values that are required to extract the data.
I suggest that you look at the post here which gives an example of doing this and includes a downloadable workbook to use, test and modify. The example includes a small sub routine to make the web query from the populated cells in one of the sheets.