#1   Report Post  
Madvikefan
 
Posts: n/a
Default Changing Hyperlinks?

Ok, I have a problem...
When I begin to change 312 some hyperlinks in a worksheet
By starting out with:
Fix Hyperlinks (#FixHyperlinks)
Sub FixscannedHyperlinks()
Dim OldStr As String, NewStr As String
OldStr="S:\users\Z011528\matt p\scanned dwgs\"
NewStr="S:\Sundata\cad\maintenance\scanned dwgs\"
Dim hyp As Hyperlink
For Each hyp In Activesheet.Hyperlinks
hyp.Address=Replace(hyp.Address, OldStr, NewStr)
Next hyp
End Sub

Excel Prompts me with a "compile error" "expected indentifier"
and the first line:
Fix Hyperlinks (#FixHyperlinks) is highlighted in red!

Whats wrong??

  #2   Report Post  
bj
 
Posts: n/a
Default

I assume (shudder) that the "Fix Hyperlinks (#FixHyperlinks)" line is a comment
insert a hyphen in front of it and retry. If it is not a comment, What is it
for?


"Madvikefan" wrote:

Ok, I have a problem...
When I begin to change 312 some hyperlinks in a worksheet
By starting out with:
Fix Hyperlinks (#FixHyperlinks)
Sub FixscannedHyperlinks()
Dim OldStr As String, NewStr As String
OldStr="S:\users\Z011528\matt p\scanned dwgs\"
NewStr="S:\Sundata\cad\maintenance\scanned dwgs\"
Dim hyp As Hyperlink
For Each hyp In Activesheet.Hyperlinks
hyp.Address=Replace(hyp.Address, OldStr, NewStr)
Next hyp
End Sub

Excel Prompts me with a "compile error" "expected indentifier"
and the first line:
Fix Hyperlinks (#FixHyperlinks) is highlighted in red!

Whats wrong??

  #3   Report Post  
AlfD
 
Posts: n/a
Default

Hi!

It should be red!

I take it it is meant to be a title or comment, in which case, put a '
in front of it.

Alf

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 following in copies of original file Neat Excel Discussion (Misc queries) 3 February 10th 05 02:28 AM
Problems with hyperlinks Lynde Excel Discussion (Misc queries) 5 January 14th 05 08:39 PM
Can 2 different hyperlinks be in the same Excel cell? rynes01 Excel Worksheet Functions 2 December 7th 04 05:15 PM
hyperlinks and copying a worksheet kimare Excel Worksheet Functions 1 November 23rd 04 03:43 PM
up-date hyperlinks in Excel PM Excel Worksheet Functions 0 November 11th 04 11:55 AM


All times are GMT +1. The time now is 07:32 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"