Advertisement
qharr

Untitled

Apr 27th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. say cell A1 had two words for search query e.g. android developer
  2.  
  3. that needs url encoding to handle the space between words:
  4. VBA:
  5.  
  6. "https://www.googleapis.com/customsearch/v1?alt=json&cx=016252715861662448569:taxvfdziuic&num=10&start=1&key=AIzaSyCoBjCX0YPbKfNin3tvaQxdl8aEGBH56Ec&q=" & Application.encodeURL("android developer")
  7.  
  8. which gives:
  9.  
  10. "https://www.googleapis.com/customsearch/v1?alt=json&cx=016252715861662448569:taxvfdziuic&num=10&start=1&key=AIzaSyCoBjCX0YPbKfNin3tvaQxdl8aEGBH56Ec&q=android%20developer"
  11.  
  12. You then do the request against that
  13.  
  14. .Open "GET", "https://www.googleapis.com/customsearch/v1?alt=json&cx=016252715861662448569:taxvfdziuic&num=10&start=1&key=AIzaSyCoBjCX0YPbKfNin3tvaQxdl8aEGBH56Ec&q=android%20developer", False
  15.  
  16. You can do that in the sheet with =ENCODEURL("words to be joined go here")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement