#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default hyperlinks

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default hyperlinks

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default hyperlinks

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default hyperlinks

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default hyperlinks

I'm not sure why you'd get compile errors. On what line do you get the
error and what is the error? You may also want to do something like this

Debug.print myWS.name
Debug.print myWS.Range("A19").address
Debug.print myWS.Range("R2").text

to see what's in those

--
HTH,
Barb Reinhardt



"Nak75" wrote:

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

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
autocreating hyperlinks in excel? ie 500 cells to 500 hyperlinks? terry Excel Programming 0 November 1st 07 03:55 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 11:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"