Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
HyperLinks | Excel Worksheet Functions | |||
Hyperlinks: Hyperlinks change on copy/paste? | Excel Worksheet Functions | |||
Update 2000 Excel hyperlinks to 2003 hyperlinks | Excel Worksheet Functions | |||
How toi turn-off hyperlinks [excel]? Email hyperlinks pop up ! | Excel Discussion (Misc queries) | |||
Excel Hyperlinks- cell content v. hyperlinks | Excel Discussion (Misc queries) |