View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Andibevan[_2_] Andibevan[_2_] is offline
external usenet poster
 
Posts: 128
Default merging cells/data using a Macro

Look at the text function concatenate - this can be used to link any number
of cells together in a contigiuos string

"crimsonkng" wrote in message
...
I have a 6,000-line macro. At a certain point, I need to merge data from
various cells into other cells.

I want to merge (append?) data/text from cells B1 and C1 onto existing text
in A1 but then delete B1 and C1 so that A1 "stretches" across that range
(A1:C1). I never know what the actual data/text will be in the cells,
though.

So, let's say that:
A1 contains the words "I like"
B1 contains the words "chocolate" and
C1 contains the words "ice cream."

I want to end up with "I like chocolate ice cream" in Cell A1 and, in
effect, delete the text in B1 and C1 so that A1's text "carries over" into
those cells. Or, after joining (?) the data, merge A1, B1, and C1.

Of course, I can do it manually and "record a macro" but it records the
actual words but that won't work in real life because the words/text are
always different.

Thanks, in advance.

Dan