Hello,
I am trying to make a list of files in excel. each cell needs to have a hyperlink, so when I click on the cell content it opens the file.
With excel 2003 I used this code:
With ActiveSheet
i = 0
For Each rngCell In .Range("A1:A65530")
i = i + 1
A$ = Cells(i, 2).Value + Cells(i, 1).Value
If Not IsEmpty(rngCell) Then
.Hyperlinks.Add Anchor:=rngCell, _
Address:=A$, TextToDisplay:=rngCell.Value
End If
Next
End With
where Cells(i, 2).Value is a cell that contains the directory where the file is (including the "\") - In excel 2003 the "\" was not included and had to be added.
and Cells(i, 1).Value is the cell that contains the file name
so A$ is the complete link to the file and clicking on the cell would be equivalent to double click on the file in the windows explorer.
I suppose something changed in Excel 2010.
Also is there something magic about the number 65530 ? I know there is a limit of the sheet size, but my file has 71894 rows. Excel 2003 would not load it completely but Excel 2010 did.
Please advise
Thank you
I am trying to make a list of files in excel. each cell needs to have a hyperlink, so when I click on the cell content it opens the file.
With excel 2003 I used this code:
With ActiveSheet
i = 0
For Each rngCell In .Range("A1:A65530")
i = i + 1
A$ = Cells(i, 2).Value + Cells(i, 1).Value
If Not IsEmpty(rngCell) Then
.Hyperlinks.Add Anchor:=rngCell, _
Address:=A$, TextToDisplay:=rngCell.Value
End If
Next
End With
where Cells(i, 2).Value is a cell that contains the directory where the file is (including the "\") - In excel 2003 the "\" was not included and had to be added.
and Cells(i, 1).Value is the cell that contains the file name
so A$ is the complete link to the file and clicking on the cell would be equivalent to double click on the file in the windows explorer.
I suppose something changed in Excel 2010.
Also is there something magic about the number 65530 ? I know there is a limit of the sheet size, but my file has 71894 rows. Excel 2003 would not load it completely but Excel 2010 did.
Please advise
Thank you