# Solved: Insert hyperlink into Excel



## ~Candy~ (Jan 27, 2001)

Trying to make a spread sheet with some weblinks. Some links are very short and will fit on the page, others run off the page onto another one. Is there any secret to shortening the link. It's even too long for landscape


----------



## cristobal03 (Aug 5, 2005)

This is a really bad answer, but you could change the display text.

chris.

[edit]
 is that what you're talking about?
[/edit]


----------



## ~Candy~ (Jan 27, 2001)

That would work, but I'm not sure how to do that 

This is the link that is too long:

http://www.giftcollector.com/produc...ko-l_Christmas Giftware Accessories-store.htm


----------



## ~Candy~ (Jan 27, 2001)

Here is seems to show up shorter than on my spreadsheet


----------



## cristobal03 (Aug 5, 2005)

Yeah, I thought that might be what you meant. The reason I said it was a bad answer is that you'd have to do what vBulletin does manually (right-click the cell, then from the context menu select *Hyperlink...* and modify the *Text to display:* field).

Now, if the Hyperlinks object in Excel has a displayText property (or something like that) you might be able to write some VBA that says something like,

If Hyperlink.length > 20 Then
grab first 10 chars, grab last 10 chars, assign those to variables
displayText = varFirst10 + "..." + varLast10
End If

Mind you, that's not even close to the right kind of code, I'm just demonstrating logic. I don't even know if there's a hyperlink object, actually; it might just be a collection.

Sorry that wasn't more helpful.

chris.


----------



## lagunasrfr (Feb 13, 2005)

Right Click on the cell.

Left Click on "Hyperlink"

When the panel comes up, type in your short name; i.e. Tech Support Guys in the "Text to Display Field."

In the "Address" field, type in your link; i.e. http:\\forums.techguy.org/reallylooooooooooooooooooong_address_goes_here.etc_etc_etc

This works just like a "Favorites" link in IE


----------



## ~Candy~ (Jan 27, 2001)

Ok, thanks, that shortened it, but I just noticed something else. Even before I changed that one, I can't click on any link and have a web page open  I must be doing something else wrong.


----------



## cristobal03 (Aug 5, 2005)

A bump:

There is a Hyperlink object, the property you want is *TextToDisplay*.

I'm bored and have nothing to do, I might try to toss that script together.

chris.


----------



## cristobal03 (Aug 5, 2005)

AcaCandy said:


> Ok, thanks, that shortened it, but I just noticed something else. Even before I changed that one, I can't click on any link and have a web page open  I must be doing something else wrong.


When you mouseover the cell, the pointer changes to a hand, correct? Then when you click the cell it gives you a msgbox with an error? I don't know why it does that, but if you close the msgbox and click the link again it should open fine. If that doesn't work try closing any open browser windows. That happens to me sometimes.


----------



## ~Candy~ (Jan 27, 2001)

Yeah, I get a hand. Closed browser windows, still it doesn't open 

No error message. Just nothing happens.

Wonder if my pop up blocker could be the problem? 

Hmmm.......let me turn that off.


----------



## ~Candy~ (Jan 27, 2001)

No, same thing, see hand, click on link, nada.


----------



## lagunasrfr (Feb 13, 2005)

Make sure you have a valid address in your hyperlink.

Copy the current address in your browser and paste it into the Excel hyperlink panel with Ctrl-V.

You need to do a quick click on your cell (do a double click to be sure). Holding down the mouse on the cell puts it in edit mode.


----------



## ~Candy~ (Jan 27, 2001)

It is, I can copy and paste it into a browser window and it opens


----------



## lagunasrfr (Feb 13, 2005)

I'm not saying you have to copy the link out of Excel.

I was suggesting that you be sure you have a good link in the Excel cell and that one way of doing that is to copy a valid link out of your browser into the cell's hyperlink.

You should be able to just do a fast left-click on the cell to call your browser up and get the web page.


----------



## ~Candy~ (Jan 27, 2001)

Yah, I know what you meant, I just click on it, and it won't open 

It's a good link, I posted it above


----------



## cristobal03 (Aug 5, 2005)

What happens when you put a hyperlink in a completely new/different workbook?

Also, I just don't know the VBA language enough to write that script, but I came up with an algorithm if anybody is ever interested in doing this.


----------



## ~Candy~ (Jan 27, 2001)

Bear with me, I'm on MSN messenger with XL GURU


----------



## lagunasrfr (Feb 13, 2005)

Just tried the hyperlink with the link you gaveand it worked. I'm using Excel 2003 if that makes any difference.


----------



## ~Candy~ (Jan 27, 2001)

Yeah, thanks, everyone, I'm using 2003 as well.

I took the lazy easy way out and XL Guru just did it for me. Big hugs and kisses 



I'll have to compare mine against his and see what part of me being an idiot that I missed


----------



## XL Guru (Aug 30, 2003)

AcaCandy said:


> Bear with me, I'm on MSN messenger with XL GURU


OMG, that must be awful for you.   L8rs ma'am.


----------



## ~Candy~ (Jan 27, 2001)

Bear? Bare? 

Oh well  Thanks again


----------

