Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hyperlinks.Add does nothing


hi,

IN VBA
i have copied one sheet in another (copy/pastespecialthe whole sheet
with values & formats:(i don't want to use the Paste method, onl
PasteSpecial).
Now i want to copy hypelinks too so i do that:

For Each h In FirstSheet.Hyperlinks
SecondSheet.Hyperlinks.Add(Anchor:=h.Range, Address:=h.Address
TextToDisplay:=Switch(Not IsEmpty(h.TextToDisplay), h.TextToDisplay
IsEmpty(h.TextToDisplay), h.TextToDisplay))
Next h


but the links are not copied: SecondSheet has no links....
In a debugguer, i can see that the loop is running fine, bu
SecondSheet.HyperLinks.Count is always 0....


What does that mean?

Regards,
iTarna

--
itarna
-----------------------------------------------------------------------
itarnak's Profile: http://www.excelforum.com/member.php...fo&userid=2786
View this thread: http://www.excelforum.com/showthread.php?threadid=47971

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hyperlinks.Add does nothing


Hello Itarnak,

The problem appears to be the Hyperlink address, you are using th
cell's address instead of its contents. Change your code to this...


Code
-------------------

For Each h In FirstSheet.Hyperlinks
SecondSheet.Hyperlinks.Add(Anchor:=h.Range, Address:=h.Range.Value, TextToDisplay:=Switch(Not IsEmpty(h.TextToDisplay), h.TextToDisplay, IsEmpty(h.TextToDisplay), h.TextToDisplay))
Next h

-------------------

--
Leith Ros

-----------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846
View this thread: http://www.excelforum.com/showthread.php?threadid=47971

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 Jerry Foley Excel Worksheet Functions 4 October 30th 08 01:12 AM
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


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