Auto incrementing a network path

chandel

New Member
Joined
Nov 30, 2017
Messages
3
Hi
Need help with auto incrementing a network path in excel 2010...
for example: column B contains a random list of numbers starting at cell B2 and going upto B101:
A B C D E
1
2 234
3 239
4 111
5 553
6 312
7 876
8 232
9 121
. .
. .
. .
101 466

I want to assign a hyperlink "\\10.23.22.11\photo\images\pic001.jpg" to the first number '234' in cell B2, which i did.
But then i want to auto fill the hyperlink to the subsequent cells and not insert them one by one for each number. i.e. while using the auto fill i want to increase the path's pic number by 1 in the successive hyperlinks like pic002.jpg, pic003.jpg...pic100.jpg so that each number is linked with an hyperlink as follows...
234 linked with \\10.23.22.11\photo\images\pic001.jpg
239 linked with \\10.23.22.11\photo\images\pic002.jpg
111 linked with \\10.23.22.11\photo\images\pic003.jpg
553 linked with \\10.23.22.11\photo\images\pic004.jpg
.
.
.
466 linked with \\10.23.22.11\photo\images\pic100.jpg

Thanks in advance for any help on this.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
I want to assign a hyperlink "\\10.23.22.11\photo\images\pic001.jpg" to the first number '234' in cell B2, which i did.

Hi, welcome to the forum!

Here is another option, first remove your manually created hyperlink and in it's place use the formula in B2 and copy it down.


Excel 2013/2016
AB
1
2234\\10.23.22.11\photo\images\pic001.jpg
3239\\10.23.22.11\photo\images\pic002.jpg
4111\\10.23.22.11\photo\images\pic003.jpg
5553\\10.23.22.11\photo\images\pic004.jpg
6312\\10.23.22.11\photo\images\pic005.jpg
7876\\10.23.22.11\photo\images\pic006.jpg
8232\\10.23.22.11\photo\images\pic007.jpg
9121\\10.23.22.11\photo\images\pic008.jpg
Sheet1
Cell Formulas
RangeFormula
B2=HYPERLINK("[URL="file://\\10.23.22.11\photo\images\pic"&TEXT(ROWS(B$2:B2),"000")&".jpg")
 
Upvote 0
Thanks mole999 and FormR for your prompt replies. I appreciate.
FormR's solution got me quite close to what i actually wanted. Thanks for that FormR.
Though still unable to include this hyperlink progressively to the numbers in cell A.
But again if that can't be done it would be fine as i can sustain with FormR's answer.
Thanks again guys.
 
Upvote 0
Though still unable to include this hyperlink progressively to the numbers in cell A.

Hi, if you want the hyperlinks in the same cell as the list of random numbers then you can try this macro to add them.

Assumes your list is in column A starting on row 2.

Rich (BB code):
Sub AddHLinks()
Dim i As Long
For i = 2 To Range("A" & Rows.Count).End(xlUp).Row
  If Len(Range("A" & i).Value) Then
    ActiveSheet.Hyperlinks.Add Anchor:=Range("A" & i), Address:="\\10.23.22.11\photo\images\pic" & Format(i - (2-1), "000") & ".jpg", _
    TextToDisplay:=CStr(Range("A" & i).Value)
  End If
Next i
End Sub
 
Upvote 0
Hi, if you want the hyperlinks in the same cell as the list of random numbers then you can try this macro to add them.

Assumes your list is in column A starting on row 2.

Rich (BB code):
Sub AddHLinks()
Dim i As Long
For i = 2 To Range("A" & Rows.Count).End(xlUp).Row
  If Len(Range("A" & i).Value) Then
    ActiveSheet.Hyperlinks.Add Anchor:=Range("A" & i), Address:="\\10.23.22.11\photo\images\pic" & Format(i - (2-1), "000") & ".jpg", _
    TextToDisplay:=CStr(Range("A" & i).Value)
  End If
Next i
End Sub


Thanks much FormR...worked like a charm. Appreciate your help.
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,702
Members
449,048
Latest member
81jamesacct

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