Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default merging cells/data using a Macro

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default merging cells/data using a Macro

Sorry for taking up bandwith but, omigod, thanks Andi, that's awesome. Works
perfectly! Shame on me for not knowing that. Thanks a lot!

"Andibevan" wrote:

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
merging cells and not losing data Ellen Excel Worksheet Functions 1 June 27th 08 09:37 PM
merging cells together but keeping all data from the cells Pete C[_2_] Excel Discussion (Misc queries) 3 May 16th 08 10:14 PM
Merging Cells that contain data anomaly Edelmundo Excel Discussion (Misc queries) 1 June 13th 06 06:04 PM
Merging Cells with Data In Them hellonpluto Excel Discussion (Misc queries) 3 May 11th 06 02:45 PM
merging data cells kraway Excel Discussion (Misc queries) 2 March 31st 06 03:06 PM


All times are GMT +1. The time now is 07:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"