GetURL to update on new entries

zefrogi

New Member
Joined
Feb 25, 2022
Messages
15
Office Version
  1. 365
Platform
  1. Windows
I'm using the GetURL code to retrieve URLs from hyperlinks:

VBA Code:
Function GetURL(cell As Range, Optional default_value As Variant)
      If (cell.Range("A1").Hyperlinks.Count <> 1) Then
          GetURL = ""
     Else
        GetURL = cell.Range("A1").Hyperlinks(1).Address
     End If
End Function

I have two columns one for a selection of links and then a URL column with the =GetURL([@Link])

The code and formula works great when I use it over already established hyperlinks in the Link column. The issue I'm having is if I enter a new weblink in the Link column then the formula in the URL column beside doesn't update once I've pressed enter. I need to go back in to editing the cell either by double click or F2 and if I press enter than the URL column does update.

So I'm looking for that automation of when I enter a web address that the =GetURL formula triggers first time. Is this something that's possible?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,223,888
Messages
6,175,205
Members
452,618
Latest member
Tam84

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