Web hyperlink in excel based on cell value? e.g. http://google.com/searchq=(a1)

EvoUK

New Member
Joined
Jul 1, 2022
Messages
20
Office Version
  1. 365
Platform
  1. Windows
Hi,

I am aware excel can create URL to websites.
However, is it possible to create a hyperlink to a website but specify a section of the URL based on data within a particular cell? Similar to how excel formulas function based on specifying particular cells but for web hyperlinks.

E.g. the initial URL is

and cell A1 is
bird

then the URL will become

And as the A1 data changes, the ending suffix of the hyperlink will update accordingly.

I'm sure there probably is an easy way to do this but I have been struggling to find any methods explaining the process.
Any help would be appreciated.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Excel Formula:
=HYPERLINK("http://www.google.com/search?q="&A1&"&safe=active",A1&" - Google Search")
 
Upvote 0
Thanks, thats exactly what I was looking for.
Hi,

Follow up on my previous request.

Is it possible to use the same hyperlink formula (hyperlink based on variable data within a cell) on an object/image in excel?

I tried applying the same formula onto an image but received an error stating something was missing.
 
Upvote 0
Sorry beyond my level of knowledge but would guess there is a vba option available , problem i see is that doing a reverse image lookup via google anyway is that it is a 2 step process in that (1)you have to load the image to the image search (2) this generates an ID of some sort that is used for the search.

image search.xlsx
AB
1birdbird - Google Search
2birdbird -Google image search
3
Sheet1
Cell Formulas
RangeFormula
B1B1=HYPERLINK("http://www.google.com/search?q="&A1&"&safe=active",A1&" - Google Search")
B2B2=HYPERLINK("https://www.google.com/search?q=" & A2 &"&tbm=isch",A2&" -Google image search")
 
Upvote 0
Sorry beyond my level of knowledge but would guess there is a vba option available , problem i see is that doing a reverse image lookup via google anyway is that it is a 2 step process in that (1)you have to load the image to the image search (2) this generates an ID of some sort that is used for the search.

image search.xlsx
AB
1birdbird - Google Search
2birdbird -Google image search
3
Sheet1
Cell Formulas
RangeFormula
B1B1=HYPERLINK("http://www.google.com/search?q="&A1&"&safe=active",A1&" - Google Search")
B2B2=HYPERLINK("https://www.google.com/search?q=" & A2 &"&tbm=isch",A2&" -Google image search")
Hi,

Thanks for getting back to me.

Apologies, I probably didn’t explain my previous question properly.

The formula you provided earlier works perfectly and was exactly what I was after (e.g. the weblink updating based on the end prefix defined in a specific cell).
Excel Formula:
=HYPERLINK("http://www.google.com/search?q="&A1&"&safe=active",A1&" - Google Search")

However, the issue I currently have is that when I access the spreadsheet via a mobile device, I struggle to get the weblink to open.
This doesnt seem to be an issue if I add the link to an image button (e.g. a graphical shape) and the weblink seem to open easily/fine everytime I click on it.

Is is possible to apply the hyperlink formula or a varient of it to a shape/image within the excel document (e.g. the blue box in the image below) as opposed to the weblink/URL being applied to a text link?


1666610374462.png
 
Upvote 0
Vba not my best but this is probably close to what you want you can get rid of the text option then and just use button
1666614846830.png

Testbutton.xlsm
ABC
1birdbird - Google Search
Sheet1
Cell Formulas
RangeFormula
B1B1=HYPERLINK("http://www.google.com/search?q="&A1&"&safe=active",A1&" - Google Search")

1666614915865.png

Add the following code
VBA Code:
Private Sub CommandButton1_Click()
ActiveWorkbook.FollowHyperlink _
Address:="http://www.google.com/search?q=" & Range("A1")
End Sub
1666614991499.png


Adjust button colour and text in properties
1666615143307.png
 
Upvote 0
Solution

Forum statistics

Threads
1,214,643
Messages
6,120,707
Members
448,981
Latest member
recon11bucks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top