#1   Report Post  
Posted to microsoft.public.excel.links
external usenet poster
 
Posts: 2
Default Hyperlinks

I have a spreadsheet which contains over 1,000 hyperlinks to a website.
Many don't work because they are missing two semi-colons.

Is there a quick way to check which ones have the missing semi-colons and to
insert them. There are two places in the hyperlink where they should
occur - always before &version and always at the end of the hyper link.

Any pointers in the right direction would be greatly appreciated.

Rusty


  #2   Report Post  
Posted to microsoft.public.excel.links
external usenet poster
 
Posts: 2
Default Hyperlinks

Hi Bill,

Thank you so much - that worked like a charm.

Cheers,
Rusty

"Bill Manville" wrote in message
...
I would think something like this (which assumes all the hyperlinks are
in the active worksheet and that all hyperlinks in the worksheet that
contain "&version" need to be checked):

Sub RepairHyperlinks()
Dim H As Hyperlink
Dim stAddr As String
Dim iChar As Integer
For Each H In ActiveSheet.Hyperlinks
stAddr = H.Address
iChar = InStr(stAddr, "&version")
If iChar0 Then
If Mid(stAddr,iChar-1,1)<";" Then
stAddr=Left(stAddr,iChar-1) & ";" & Mid(stAddr,iChar)
End If
If Right(stAddr,1)<";" Then stAddr = stAddr & ";"
H.Address = stAddr
End If
Next
End Sub

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup



  #3   Report Post  
Posted to microsoft.public.excel.links
external usenet poster
 
Posts: 473
Default Hyperlinks

I would think something like this (which assumes all the hyperlinks are
in the active worksheet and that all hyperlinks in the worksheet that
contain "&version" need to be checked):

Sub RepairHyperlinks()
Dim H As Hyperlink
Dim stAddr As String
Dim iChar As Integer
For Each H In ActiveSheet.Hyperlinks
stAddr = H.Address
iChar = InStr(stAddr, "&version")
If iChar0 Then
If Mid(stAddr,iChar-1,1)<";" Then
stAddr=Left(stAddr,iChar-1) & ";" & Mid(stAddr,iChar)
End If
If Right(stAddr,1)<";" Then stAddr = stAddr & ";"
H.Address = stAddr
End If
Next
End Sub

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup

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
Hyperlinks: Hyperlinks change on copy/paste? Rick S. Excel Worksheet Functions 0 November 13th 07 08:19 PM
Update 2000 Excel hyperlinks to 2003 hyperlinks lonv155 Excel Worksheet Functions 4 October 25th 07 05:51 AM
How toi turn-off hyperlinks [excel]? Email hyperlinks pop up ! jacob735 Excel Discussion (Misc queries) 1 June 22nd 07 12:57 AM
Excel Hyperlinks- cell content v. hyperlinks herpetafauna Excel Discussion (Misc queries) 2 May 23rd 06 04:39 AM
hyperlinks Michele Excel Discussion (Misc queries) 1 March 9th 05 03:09 PM


All times are GMT +1. The time now is 09:44 PM.

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"