Help with Copy and Paste

  • Thread starter Thread starter Smonczka
  • Start date Start date
S

Smonczka

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
 
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

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top