script to increase last number in cell entry for hyperlink

K

kim

Hi
I have an excel sheet with 4,000 rows each having a record of a picture. I
need to hyperlink a cell entry in each row to open the picture when it is
clicked.
I can do this through insert hyperlink command but don't want to do it 4,000
times!

Is there a way to do this with vba? Either from a macro button or running a
script that would increment the file name by 1 digit for each row i.e.
Filepathpicture1 (set by hyperlink)
filepathpicture2
filepathpicture3 and so on with the script changing the picture number.
Thanks
 
G

Gary''s Student

VBA is really not needed here:

In A1 enter:

C:\Documents and Settings\Owner\My Documents\My Pictures\100_006

In B1 enter:

=ROW()&".jpg"

In C1 enter:

=HYPERLINK(A1 & B1)

This will hyperlink to 100_0061.jpg

Just copy A1 thru C1 down the column to increase the numerical sequence.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top