View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default Add Hyperlink to Cell


I'm trying to point to files and add a hyperlink to each cell. This is my
code.
Sub FindFiles()
Dim rng As Range
Dim lRow As Long
Dim Filename As Variant
Filename = Application.GetOpenFilename(FileFilter:="Excel File
(*.xls),*.xls", MultiSelect:=True)
If TypeName(Filename) < "Boolean" Then
Range("A1").Resize(UBound(Filename, 1) - LBound(Filename, 1) + 1).Value =
Application.Transpose(Filename)
End If

lRow = Range("A65536").End(xlUp).Row
Set rng = Range("A1:A" & lRow)
For Each c In rng
c.Hyperlinks.Add
Next

End Sub

It fails he
c.Hyperlinks.Add

Any idea why?

Thanks,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.