Creating multiple hyperlinks in a single cell.

4,175 views
Skip to first unread message

elsammons

unread,
Mar 6, 2009, 12:24:19 PM3/6/09
to python-excel
I have a need to take data, similar to the following:

array = ['11111','22222','33333','4444','5555']

And place this data into a single cell as multiple hyperlinks. Both
Open Office and Excel support creating multiple hyperlinks in a cell,
using Insert->hyperlink.

I know how to and have successfully placed the text itself into a
single cell.

i.e. A,4 11111 22222 33333 4444 5555

Anyone know if xlwt will allow my to create multiple links, one per
grouping. For the record, I know how to create a single link using
=HYPERLINK('.....'); however, there seems to be a limitation here that
only one HYPERLINK formula can be used in a single cell and I have not
found a way to create a compound formula here.

Any assistance is greatly appreciated!

Thank you!

John Machin

unread,
Mar 6, 2009, 4:29:42 PM3/6/09
to python...@googlegroups.com
On 7/03/2009 4:24 AM, elsammons wrote:
> I have a need to take data, similar to the following:
>
> array = ['11111','22222','33333','4444','5555']
>
> And place this data into a single cell as multiple hyperlinks. Both
> Open Office and Excel support creating multiple hyperlinks in a cell,
> using Insert->hyperlink.

That's interesting. I didn't find a way with Excel 2003 to avoid the
second insertion replacing the first. AFAICT from Googling, it's not
possible, but could be faked by (a) having one hyperlink to a data
validation table [not supported by xlwt] or (b) something that involved
inserting a Word object [not supported by xlwt]. Please tell us what
incantations are necessary in what version(s) of Excel, and upload a
small sample XLS file to the files section of this group.

> I know how to and have successfully placed the text itself into a
> single cell.
>
> i.e. A,4 11111 22222 33333 4444 5555
>
> Anyone know if xlwt will allow my to create multiple links, one per
> grouping.

Yes. It doesn't.

> For the record, I know how to create a single link using
> =HYPERLINK('.....'); however, there seems to be a limitation here that
> only one HYPERLINK formula can be used in a single cell

No "seems". There is definitely a general restriction that that there
can be only one cell record per cell (i.e. irrespective of whether it's
a formula record or not, let alone inspecting the contents of the
formula) otherwise Excel pops up a user-frightening "dialogue" box
saying something like "Data may have been lost".

> and I have not
> found a way to create a compound formula here.

A "compound formula" is a novel concept -- please explain.

Cheers,

John

elsammons

unread,
Mar 9, 2009, 10:01:04 AM3/9/09
to python-excel
After some additional testing this appears to be a feature of OO and
not Excel. It seems that in OO I am able to populate A1 with CNN
MSNBC GOOGLE; highlight a single TEXT (CNN for example) and then using
Insert->Hyperlink. Rince / repeat for each item in the cell.
However, upon saving this ODF in XLS format the multiple hyperlinks
are lost.

I guess just another example of why Open Source rocks :-D

Thank you!

John Machin

unread,
Mar 9, 2009, 10:17:46 AM3/9/09
to python...@googlegroups.com
On 10/03/2009 1:01 AM, elsammons wrote:
> After some additional testing this appears to be a feature of OO and
> not Excel.

Next time, please consider doing "additional testing" *before* posting.

Reply all
Reply to author
Forward
0 new messages