ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with Copy and Paste (https://www.excelbanter.com/excel-programming/321333-help-copy-paste.html)

SMonczka

Help with Copy and Paste
 
I am trying to copy the text from one cell to another without
overwriting the Hyperlink in the second cell.

Example

A1 = Chapter 4 B1=\\My Documents\Chapter4.txt

A1 is text and B1 is a link to the TXT file.

I want B1 to = Chapper 4 but still keep the hyperlink of \\My
Documents\Chapter4.txt

I can do this by selecting the first cell, hitting F2, highlighting the
text for that cell and coping it. Then I have to select the second
cell, hitting F2, highlight the text in that cell and pasting the new
text. This keeps the original hyperlink of the second cell intact.
And while this works for a changing a limited number of cells, I have
to do this for 3,000 records. And I have been unable to create a macro
that will do it for me.

Any suggestions?

Thanks 

Steve


Charles Harmon

Help with Copy and Paste
 
Hi try,

Sub yourmacro()
Dim i As Integer
For i = Range("a65536").End(xlUp).Row To 1 Step -1
Cells(i, 2).Value = Cells(i, 2) & Cells(i, 1)
Next
End Sub

"Smonczka" wrote in message
oups.com...
I am trying to copy the text from one cell to another without
overwriting the Hyperlink in the second cell.

Example

A1 = "Chapter 4" B1="\\My Documents\Chapter4.txt"

A1 is text and B1 is a link to the TXT file.

I want B1 to = "Chapper 4" but still keep the hyperlink of "\\My
Documents\Chapter4.txt"

I can do this by selecting the first cell, hitting F2, highlighting the
text for that cell and coping it. Then I have to select the second
cell, hitting F2, highlight the text in that cell and pasting the new
text. This keeps the original hyperlink of the second cell intact.
And while this works for a changing a limited number of cells, I have
to do this for 3,000 records. And I have been unable to create a macro
that will do it for me.

Any suggestions?

Thanks ?

Steve



SMonczka

Help with Copy and Paste
 
Thanks



All times are GMT +1. The time now is 12:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com