I'm trying to build a sheet where it would create custom Google search links, for example:
In Column 1, I would insert the first string of search terms: Apple, Orange, Grapes
In Column 2, I insert the second string of search terms: Ice Cream, Juice
And it should automatically put them into a search string with boolean for review, like:
Then I will have a final cell that automatically generates a hyperlinked URL for Google using something like:
So here is the problem:
The sheet I made works up to a certain point, around 8 words total, then the hyperlink generated returns with the VALUE error for I'm guessing too many characters in the URL.
I manually made a search URL for longer than 8 words, which confirms that it works so it's not Google but rather Excel that doesn't like it to be over a certain limit.
I tried putting the google address in another cell and just reference it in the =HYPERLINK formula, but that only saves so many characters where I can maybe put in an extra word or two.
Any pointers would be great!
Note: I am a beginner at VBA, I tried a solution for a similar problem posted on this forum HERE. Followed the comments step by step but I'd get Runtime Error 13 and debugging shows a problem in Line 20. Maybe I did something wrong, I'm not sure.
In Column 1, I would insert the first string of search terms: Apple, Orange, Grapes
In Column 2, I insert the second string of search terms: Ice Cream, Juice
And it should automatically put them into a search string with boolean for review, like:
("Apple" AND "Orange" AND "Grapes") AND ("Ice cream" OR "Juice")
Then I will have a final cell that automatically generates a hyperlinked URL for Google using something like:
The goal is to save time, since it does become quite a chore when there are many search terms putting them in quotes and adding boolean for each word. It's also not easier going back and forth in the tiny search bar looking for terms you want to change in a long search string.=HYPERLINK("http://www.google.com/search?q="&L3&E3&L7,"Custom Search"
So here is the problem:
The sheet I made works up to a certain point, around 8 words total, then the hyperlink generated returns with the VALUE error for I'm guessing too many characters in the URL.
I manually made a search URL for longer than 8 words, which confirms that it works so it's not Google but rather Excel that doesn't like it to be over a certain limit.
I tried putting the google address in another cell and just reference it in the =HYPERLINK formula, but that only saves so many characters where I can maybe put in an extra word or two.
Any pointers would be great!
Note: I am a beginner at VBA, I tried a solution for a similar problem posted on this forum HERE. Followed the comments step by step but I'd get Runtime Error 13 and debugging shows a problem in Line 20. Maybe I did something wrong, I'm not sure.