I'm new to macros and I'm trying to automate the following task: I have a long list of medical writers and I want to plug their names into the search box at www.evidence.nhs.uk/ and copy the list of medical papers each one has witten and put it in a spreadsheet (see attached).
I've set up the code to loop through each row and send a webquery for each name - it then tidies up the results (which for some reason are inserted in different cells all down the column), numbers them and stick them in one cell.
When I run the macro it works fine for the first few names then gives up and I get a 1004 error 'this operation cannot be done because the data is refreshing in the background.' Sometimes 'External Data' plus a number appears in the cell where the query data should go.
I've not much idea how webqueries work so I'm stuck...here is the query code:
I've tried making BackgroundQuery or Refresh BackgroundQuery = False, tried to delete queries after each loop...in fact I've wasted a weekend trying to save myself work next week...!![]()
Please Login or Register to view this content.
Bookmarks