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.

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

<tbody>
</tbody>
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
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,214,950
Messages
6,122,428
Members
449,083
Latest member
Ava19

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