Thread: hyperlinks
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Nak75 Nak75 is offline
external usenet poster
 
Posts: 5
Default hyperlinks

Thanks so far but when I copy the code into a procedure I got compile errors.
You dimmed myWS, should I dim anchor and address as well and if yes what is
it? a string. or are anchor and adress VBA objects. I tried several things
but all these failed. Sorry to bother yu again but could you pls help me out.

Thanks

"Barb Reinhardt" wrote:

Dim myWS as Worksheet

Set myWS = activesheet

myWS.Hyperlinks.Add _
anchor:= myWS.Range("A19") _
Address:=myWS.Range("R2").Text, _
TextToDisplay:=myWS.Range("R2").Text
--
HTH,
Barb Reinhardt



"Nak75" wrote:

Thanks but unfortunately it did not work. should my url get the value of the
address? The only thing I am looking for is to activaye the particular cell
with the new contents. In the worksheet one should just activate the input
bar create hard return and this should done by a macro.

The simple code is as follows
Range("R2").Select
Selection.Copy
Range("A19").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
A19 contains a text that should be a hyperlink. The old value of that
cell should be remoevd. Hoever in the current setup the old value still exist
underneath. This might be caused to a background query.

Many thanks for any further advice

"Barb Reinhardt" wrote:

This line of code should help you

myWS is theworksheet I'm adding the hyperlink to.

myWS.Hyperlinks.Add _
anchor:= myWS.Range("C5") _
Address:=myURL, _
TextToDisplay:=TextToDisplay

--
HTH,
Barb Reinhardt



"Nak75" wrote:

I want to send file by using hyperlinks for the address. However, if I copy a
new adres in a cell, the cell displays the new name but underneath the old
adress is still there resulting in an email with the old adress. By
activating the inptu bar and double click it this is resolved. However I want
to do it by a macro in one go. Who could help me out? Many thanks

Frank