Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hyperlinks: Hyperlinks change on copy/paste? | Excel Worksheet Functions | |||
autocreating hyperlinks in excel? ie 500 cells to 500 hyperlinks? | Excel Programming | |||
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) |