Hyperlinked index?

Kath

New Member
Joined
Sep 15, 2008
Messages
7
Hi everyone - my first post!:biggrin: I hope someone here might be able to assist me.

I would like to hyperlink each row of my Excel spreadsheet to the corresponding photo of the person in that row. All the photos in a batch are sequentially numbered in the same order as the rows.

Eg the first row of the spreadsheet for batch 2 might be:

Doe John, London, Male

and the first photo in batch 2 (a photo of John Doe) would be called, say, C:/images/batch2/0243.jpg

The next row might be:

Doe Jane, New York, Female

and the second photo in batch 2 (a photo of Jane Doe) would be C:/images/batch2/0244.jpg

Clicking on any cell in a person's row would bring up their photo. Ultimately I want to sort the rows alphabetically by surname, so each hyperlink would need to move with its person to keep their photo linked to their record.

Is there a quick way to do this, rather than manually using Insert Hyperlink for each row?:eek: I've seen some similar threads here, but couldn't find anything precisely on this one. I imagine it must be a fairly common requirement.:eek:

Any help appreciated.:cool:
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
=HYPERLINK("C:\images\batch2\0" &ROW()+242&".jpg")

then copy and paste special as a value.


(edit the 242 to match the row you start on.) 242 assumes you are starting on row 2
 
Upvote 0
Thanks for the quick reply, kgkev:cool: - I'll have a play around with that and let you know how I get on.
 
Upvote 0
Hi kgkev and everyone else!:biggrin:

=HYPERLINK("C:\images\batch2\0" &ROW()+242&".jpg") plus copy and paste works nicely to generate the correctly named list of hyperlinks, so thanks for that. I even understand how it works, which is a bonus!

I didn't know one could paste into a range of cells to autofill them - very cool.:cool:

Just a cosmetic thing, I hope, but at the moment I've got the links showing up in a column to the right of the index entries; ideally I would like each cell itself to be hyperlinked, and the paths not to be present as an additional column at all.

Ie the only entries would be along the lines of:

Doe John|London|Male
Doe Jane|New York|Female

where each of the six cells is a hyperlink, the first row to John Doe's photo, and the second row to Jane Doe's photo.

Is that do-able?:eek: Thanks in advance for any thoughts.
 
Upvote 0
Assuming The Name is in A1

=HYPERLINK("C:\images\batch2\0" &ROW()+242&".jpg",A1)

Then Copy and Paste Special into A1(or wherever)

Explanation....

=hyperlink("LOCATION",Friendly Name")

So you will end up with john doe So if clicked you will see a picture
 
Upvote 0
Success!:biggrin:

Assuming The Name is in A1

=HYPERLINK("C:\images\batch2\0" &ROW()+242&".jpg",A1)

Then Copy and Paste Special into A1

kgkev, I found that Copy and Paste Special retains the result of the calculation, but loses the hyperlink - it just outputs in standard unlinked text - but I can imagine adding in the hyperlink after the calc would work.

No problem, though; instead I used the dos command

dir c:\images\batch2\ /b >c:\batch2list.xls

to output all the file names immediately as a column in an Excel spreadsheet.:cool: That will even work if ever they are non-sequential!

I then used your formula to make A1 etc the output, but created the input A1 on sheet 2 to avoid circularity. Have I understood correctly?

So you will end up with john doe So if clicked you will see a picture
Yes!

I had hoped that the hyperlinks would be "self-contained", ie without the need to refer to other cells elsewhere behind the scenes. I had already achieved this cell-by-cell before getting in touch, by using "insert hyperlink" each time. However, in that case the hyperlinks appear to behave differently, being part of the cell format rather than the content, so they don't move with their respective cells when resorting the rows. Anyone, correct me if I'm wrong about this.

In any case, any further guidance on how to do it en masse is welcomed! Great site & thanks again!
 
Upvote 0
Suppose
A1 contains your Name (FRED)
B1 Contains Your Link (c:\images\batch2\0244.JPG)

Put


Code:
="=hyperlink("""&B1&""","""&A1&""")"

in C1 this will result in =hyperlink("C:\images\batch2\0244.jpg","FRED")

Copy and Paste special this into any other cell - this is now a self contained formula.

This is where my problems start.

The only way I could get this to change to an actual formula was to

F2, return -> down the list ok if you have 100 but not 1000 (your fingers will hurt)


OR

Copy and paste all the cells into NotePad

The then copy and paste them back - Should work but you might have to set the formating straight

Copy and Paste Special (formats) from a real hyperlink to sort this out.
 
Upvote 0
Nice one, kgkev! An elegant simplification.:cool:

It works well - & I tweaked Copy & Paste in and out of Notepad as you suggested.

My original thinking was not to show the numeric image file names, since they are "internal" to the application and there is no obvious reason for the user to know them; they simply reflect the order in which the records/images were created.

However, it can be helpful to the end user to see them after all. Eg when we deliver multiple batches of images for import into a database and they need to know where one ends and the next starts. Therefore your straightforward method is spot on for what is required.

kgkev, you are a star!(y)
 
Upvote 0

Forum statistics

Threads
1,214,914
Messages
6,122,211
Members
449,074
Latest member
cancansova

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