Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Hyperlink creation problem

Not really an excel guy so I need help. I have a dataset that is
imported to excel. One of the columns contains a hyperlink to an
external pdf file. When the spreadsheet is first opened the column
isn't recognized as a hyperlink. However if I click into it to edit it
then exit (without making any changes) the hyperlink becomes active
for as long as I have the workbook open. When the workbook is saved,
closed and reopened the hyperlink appears to be valid. However when
you click on it you get a 404 error. until you F2 and exit the field.
At which point it works. To say I'm completely stumped is an
understatement.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Hyperlink creation problem

Try this code to repair the hyperlinks. You didn't say what range they are
in so adjust the code to reflect your range.

Sub FixHyperlinks()
Dim Lrow As Long
Dim rng As Range
Dim c As Range
'change the B in the next 2 lines to your column
Lrow = Cells(Rows.Count, "B").End(xlUp).Row
Set rng = Range("B1:B" & Lrow)
For Each c In rng
If c.Hyperlinks.Count = 0 And Not c.Value = "" Then
ActiveSheet.Hyperlinks.Add Anchor:=c, Address:=c.Text
End If
Next c
End Sub

Mike F
wrote in message
oups.com...
Not really an excel guy so I need help. I have a dataset that is
imported to excel. One of the columns contains a hyperlink to an
external pdf file. When the spreadsheet is first opened the column
isn't recognized as a hyperlink. However if I click into it to edit it
then exit (without making any changes) the hyperlink becomes active
for as long as I have the workbook open. When the workbook is saved,
closed and reopened the hyperlink appears to be valid. However when
you click on it you get a 404 error. until you F2 and exit the field.
At which point it works. To say I'm completely stumped is an
understatement.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Hyperlink creation problem

Works perfectly the first time. It doesn't work on re-entry. Still get
a 404 error. But this is still good enough. I can make the spreadsheet
readonly and run this on open every time. Thanks very much for the
help.

On Oct 17, 3:46 am, "Mike Fogleman"
wrote:
Try this code to repair the hyperlinks. You didn't say what range they are
in so adjust the code to reflect your range.

Sub FixHyperlinks()
Dim Lrow As Long
Dim rng As Range
Dim c As Range
'change the B in the next 2 lines to your column
Lrow = Cells(Rows.Count, "B").End(xlUp).Row
Set rng = Range("B1:B" & Lrow)
For Each c In rng
If c.Hyperlinks.Count = 0 And Not c.Value = "" Then
ActiveSheet.Hyperlinks.Add Anchor:=c, Address:=c.Text
End If
Next c
End Sub

Mike wrote in message

oups.com...



- Show quoted text -



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
entering emails without hyperlink creation john vella Excel Discussion (Misc queries) 1 September 30th 06 06:25 AM
Problem with function creation terminator_ba Excel Programming 6 July 1st 06 05:17 AM
Automating hyperlink creation Steve Williams Excel Worksheet Functions 1 October 14th 05 01:50 AM
entering emails without hyperlink creation Jim Sullivan Excel Discussion (Misc queries) 6 September 25th 05 03:47 PM
Hyperlink Creation in Excel X for Mac MNMBerk Excel Worksheet Functions 1 December 15th 04 06:50 PM


All times are GMT +1. The time now is 05:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"