Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlink Increment

Status
Not open for further replies.

chasethewind

Technical User
Oct 29, 2004
63
US
I have about 200 hyperlinks to make. The file name is is pic1.jpg, pic2.jpg, etc... is there a way to have the hyperlink automatically increment to the next pic number?
 



Enter pic1 in a cell.

Drag down thru 200 rows.

VOLA!

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
It works to get the increment of the pic name, but it will not recognize the correct incremental hyperlink file. I have found a macro that does what I want, but I was wondering if something like you suggested was possible.

Credit given for macro to whomever wrote it. I don't remember what web page I was on.

Sub Increment()

Dim linkCell As Range
Dim iNumber As Integer
Set linkCell = Range("D3")
For iNumber = 173 To 375 'these are the photo numbers
ActiveSheet.Hyperlinks.Add Anchor:=linkCell, Address:="C:\Documents and Settings\adill.MSI\Desktop\CR NO. 1 Pics\Crew 2\S5000" & iNumber & ".JPG", _
TextToDisplay:="S5000" & iNumber & ".JPG"
Set linkCell = linkCell.Offset(1)
Next iNumber
End Sub
 


Column A has your pic1, pic2...

this in column b...
[tt]
=HYPERLINK("C:\"&A1&".jpg")
[/tt]

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top