View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen Per Jessen is offline
external usenet poster
 
Posts: 1,533
Default paste into destination w/o overwriting existing


Hi

Suppose you want to edit contents in A1

Range("A1").Value = Range("A1").Value & Range("B1").Value
Range("B1").ClearContents

Hopes it helps.

Regards,
Per

"SteveDB1" skrev i meddelelsen
...
Hi all.
We have a number of workbooks which list documents, in a form which we're
calling an abstract of title.
In our older workbooks, many of the abstracts list the sellers, and buyers
with 4 row, single column groups. all as unmerged cells.

With our newer formats, we now have these 4 row, 1 column groups merged
into
a single cell. It just makes for a cleaner appearing layout.

This morning I tried recording a macro to select row 2, and paste its
contents into row 1 with already existing data. I then selected row 3, and
pasted that cell's contents into those of row 1, and did the same with row
4.

Once this was complete, I merged the 4 rows, and turned on word wrap.
The problem that I saw once I went in to edit the code was that it treated
the contents as an ActiveCell.FormulaR1C1.

Which of course gives the string of contents.

I then tried recording another macro to do the same thing by copy/paste,
and
cut/paste. Once I activated the destination cell, to paste the contents of
my
source cell, the cut/copy deactivated, and would not allow me to paste the
source contents to my destination cell.

As I need this to be more generic to cover all instances of this, I'm
curious as to what else I can use to accomplish this same goal, without
over
writing the destination cell's existing contents.

How do I select a cell, cut its contents, and paste those contents into a
cell with already existing contents-- without overwriting those contents--
by
use of a macro?

The merging I can handle.
Thank you for your helps.