Long URL % Renaming

rhmkrmi

Active Member
Joined
Aug 17, 2012
Messages
341
Office Version
  1. 365
Platform
  1. Windows
Hi there,

I have been reading some posts about using a URL as hyperlink in excel that is longer that 255 characters.

I could not quite get the =HYPERLINK(A1&A2,"Click here") to work. I do not know where to split the URL. As soon as I populate A2, it errors.

I also found some macros which works but when I change the Display Name (which is something I have to do because the URL is part of the text in the cell) it fails.

Is there a trick or a macro that can be applied to the Workbook and allow changing the Display Name?

Than you.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
If the URL is an external web link, then try going to BitLy.com or Tiny.cc. You can give it a large URL and they will shorten them.

This web page from tiny.cc, returns the link
tiny.cc/qn3flz

If that is no good for you, make sure that you split on the "/"

In A1 have "https: //www.mrexcel.com/board/"
and A2 have "threads/long-url-renaming.1127662/"

To combine to make this web page.
I have put in a space after https:, to stop it resolving, but you will leave the space out.
 
Upvote 0
Thank you.

I did break it into 2 parts as you have mentioned but the =HYPERLINK(A1&A2,"Click here") returns #VALUE! and cannot be used!

Any idea?
 
Upvote 0
Have you tried?
in A3 put =A1&A2

Then use =HYPERLINK($A$3,"Click here")
 
Upvote 0
I do not know where to split the URL.

Hi, you can't split it, if the URL is greater than 255 chars then you can't use the HYPERLINK() function.

I also found some macros which works but when I change the Display Name (which is something I have to do because the URL is part of the text in the cell) it fails.

If you post the macro and let us know how/why and where it fails when you change the display name, then someone may be able to amend it for you.
 
Upvote 0
Hi there,

I am using this code for my long URL in a module and it is working fine:

Sub myurl()
ActiveWorkbook.FollowHyperlink Address:="https:// ........................"
End Sub

Obviously, it cannot launch the URL when you are disconnected from the Intranet where the page lives.
My question is, how can I avoid getting this error message and replace it with a pop-up reading "Oops! You are disconnected from the Intranet!"

1589289357321.png


Thanks.
 
Upvote 0
Hi, you could try adding some basic error handling like this.

VBA Code:
Sub myurl()
On Error GoTo ErrorHandle
    ActiveWorkbook.FollowHyperlink Address:="https:// ........................"
    Exit Sub
ErrorHandle:
    MsgBox "Oops"
End Sub
 
Upvote 0
Hi there,

Is it possible to have more than one URL at a time here:

Sub myurl()
On Error GoTo ErrorHandle
ActiveWorkbook.FollowHyperlink Address:="https:// ........................"
Exit Sub
ErrorHandle:
MsgBox "Oops"
End Sub

I need two URLs so that if one cannot be reached then the second one is tried.

Thank you.
 
Upvote 0

Forum statistics

Threads
1,214,377
Messages
6,119,183
Members
448,872
Latest member
lcaw

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