Hyperlink autofill help

OdinIII

New Member
Joined
Aug 30, 2013
Messages
8
Hello, I'm trying to simplify the addition of thousands of hyperlinks in a spreadsheet. I have the pictures in a folder and just need to figure out how to get autofill to work with the addressing.

The formula below points to the beginning of a series of pictures. How can I drag down and have the file name increment numerically?

=HYPERLINK("20181109 Audit Items\IMG_1364.JPG","IMG_1364.JPG")

This is what I'd like to happen when I drag down.

[TABLE="width: 500"]
<tbody>[TR]
[TD]=HYPERLINK("20181109 Audit Items\IMG_1364.JPG","IMG_1364.JPG")[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]=HYPERLINK("20181109 Audit Items\IMG_1365.JPG","IMG_1365.JPG")[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]=HYPERLINK("20181109 Audit Items\IMG_1366.JPG","IMG_1366.JPG")[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]=HYPERLINK("20181109 Audit Items\IMG_1367.JPG","IMG_1367.JPG")[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
You could insert just the number that needs to ascend (1364,1365 etc) and drag down the column. Then slightly edit the code I posted earlier here:

https://www.mrexcel.com/forum/excel-questions/1077242-link-lookups-corresponding-pdfs.html

Code:
Option Explicit

Sub InsertLinks()


'Decalrations
Dim LastRow As Long, cell As Range


'Error handling for blank rows in range
On Error Resume Next


'Asume a large amount of data, so turn off screen updating
Application.ScreenUpdating = False


'Find Last Row of Img Numbers (Assuming they are in column A)
LastRow = Cells(Rows.Count, "A").End(xlUp).Row


'Add hyperlink to each cell in the range from assumed range of Img numbers (A1 to A and whatever th lastrow was)
For Each cell In ActiveSheet.Range("A1:A" & LastRow)
    cell.Hyperlinks.Add Range(cell.Address), Address:="20181109 Audit Items\IMG_" & cell.Value & ".JPG", TextToDisplay:="IMG_" & cell.Value & ".JPG"
Next cell


'Turn Screen updating back on
Application.ScreenUpdating = True
End Sub

Or

List the numbers in Column A as I proposed
Then in column B: (assume Row 1 for first link)

=HYPERLINK("20181109 Audit Items\IMG_"&A1&".JPG","IMG_"&A1&".JPG")
 
Last edited:
Upvote 0
List the numbers in Column A as I proposed
Then in column B: (assume Row 1 for first link)

=HYPERLINK("20181109 Audit Items\IMG_"&A1&".JPG","IMG_"&A1&".JPG")

Thanks Cooper645,

I went with the plan above. I was focused on creating code entirely inside the Hyperlink formula and didn't think of just putting the numbers in a hidden column. Thanks again.
 
Upvote 0
Glad to have helped. Thanks for letting us know.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,205
Members
452,618
Latest member
Tam84

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