A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do I merge two cells without deleting data from the cell?



 
 
Thread Tools Display Modes
  #21  
Old November 5th, 2008, 03:22 PM posted to microsoft.public.excel.misc
rapid1
external usenet poster
 
Posts: 11
Default How do I merge two cells without deleting data from the cell?

Works perfectly Gord - and please excuse my noobness, but how do I make the
function available to all spreadsheets that I open without have to recreate
the function each time?

Ray D

"Gord Dibben" wrote:

Not without a User Defined Function like this one.

Function ConCatRange(CellBlock As Range) As String
Dim Cell As Range
Dim sbuf As String
For Each Cell In CellBlock
If Len(Cell.text) 0 Then sbuf = sbuf & Cell.text & " "
' for comma-delimited change above " " to ","
Next
ConCatRange = Left(sbuf, Len(sbuf) - 1)
End Function

Usage is: =concatrange(A1:Z1)

No blank cells will be ignored.

For similar methods with code see this search result from google

http://tinyurl.com/6ao6k4


Gord Dibben MS Excel MVP

On Wed, 6 Aug 2008 06:46:01 -0700, anthony561fl
wrote:

This works great. However, what if Im wanting to combine several columns, say
50 or 100 columns worth of data? Id hate to have to enter each cell name in
that formula. Is there a way to specify a range of columns or cells rather
than each one before and after ampersands?

  #22  
Old November 5th, 2008, 06:19 PM posted to microsoft.public.excel.misc
Gord Dibben
external usenet poster
 
Posts: 20,252
Default How do I merge two cells without deleting data from the cell?

You can copy the UDF into a general module in your Personal.xls which will
make it available for all open workbooks.

You could copy/paste it into a general module in a new workbook, save that
workbook as an Add-in which you would load through ToolsAdd-ins.

I prefer the Add-in method so's I don't have to preface the Function with
the workbook name.

i.e. if saved in Personal.xls you must enter

=Personal.xls!ConCatRange(range)

If stored in the add-in =ConCatRange(range) is sufficient.


Gord

On Wed, 5 Nov 2008 06:22:00 -0800, rapid1
wrote:

Works perfectly Gord - and please excuse my noobness, but how do I make the
function available to all spreadsheets that I open without have to recreate
the function each time?

Ray D

"Gord Dibben" wrote:

Not without a User Defined Function like this one.

Function ConCatRange(CellBlock As Range) As String
Dim Cell As Range
Dim sbuf As String
For Each Cell In CellBlock
If Len(Cell.text) 0 Then sbuf = sbuf & Cell.text & " "
' for comma-delimited change above " " to ","
Next
ConCatRange = Left(sbuf, Len(sbuf) - 1)
End Function

Usage is: =concatrange(A1:Z1)

No blank cells will be ignored.

For similar methods with code see this search result from google

http://tinyurl.com/6ao6k4


Gord Dibben MS Excel MVP

On Wed, 6 Aug 2008 06:46:01 -0700, anthony561fl
wrote:

This works great. However, what if Im wanting to combine several columns, say
50 or 100 columns worth of data? Id hate to have to enter each cell name in
that formula. Is there a way to specify a range of columns or cells rather
than each one before and after ampersands?


  #23  
Old November 7th, 2008, 11:42 AM posted to microsoft.public.excel.misc
Oli
external usenet poster
 
Posts: 15
Default How do I merge two cells without deleting data from the cell?

Hi,
I want to merge two columns...not two cells only...i have values in column B
and C and I like to merge them together in one go...the number of values I
got in the columns are more than 19,000 (i.e. I have 19000 rows of data)

Can anyone help plz?

Thanks in advance
Oli



"Peo Sjoblom" wrote:

You can't, you can concatenate 2 cells into one by using a formula and
ampersand

=A1&" "&B1


however stay away from merging cells, always cause more problems than what
it's worth and layout wise you can get very close without using it. I have
never seen a power user using merging

Regards,

Peo Sjoblom

"Batmans_Wife" wrote:

I'm highlighting two cells in the same row, hitting format cells, alignment,
merge cells and I'm getting the error message, "The selection contains
multiple data values. Merging into one cell will keep the upper-left most
data only." I want to be able to make the two seperate cells one without
deleting anything and without having to cut and paste.

  #24  
Old November 7th, 2008, 09:28 PM posted to microsoft.public.excel.misc
Gord Dibben
external usenet poster
 
Posts: 20,252
Default How do I merge two cells without deleting data from the cell?

Enter the formula provided by Peo into C1 then double-click on the fill
handle of C1 to copy to end of data in column B

BTW.............this operation would not be "merging" the columns, it would
be "combining" them.


Gord Dibben MS Excel MVP


On Fri, 7 Nov 2008 02:42:00 -0800, Oli
wrote:

Hi,
I want to merge two columns...not two cells only...i have values in column B
and C and I like to merge them together in one go...the number of values I
got in the columns are more than 19,000 (i.e. I have 19000 rows of data)

Can anyone help plz?

Thanks in advance
Oli



"Peo Sjoblom" wrote:

You can't, you can concatenate 2 cells into one by using a formula and
ampersand

=A1&" "&B1


however stay away from merging cells, always cause more problems than what
it's worth and layout wise you can get very close without using it. I have
never seen a power user using merging

Regards,

Peo Sjoblom

"Batmans_Wife" wrote:

I'm highlighting two cells in the same row, hitting format cells, alignment,
merge cells and I'm getting the error message, "The selection contains
multiple data values. Merging into one cell will keep the upper-left most
data only." I want to be able to make the two seperate cells one without
deleting anything and without having to cut and paste.


  #25  
Old December 13th, 2008, 03:04 AM posted to microsoft.public.excel.misc
J9
external usenet poster
 
Posts: 17
Default How do I merge two cells without deleting data from the cell?

Thanks that was helpful, but how do you continue the formula for a lot of
rows. It keeps repeating the 1st one down.

Thank you!

"Batmans_Wife" wrote:

I'm highlighting two cells in the same row, hitting format cells, alignment,
merge cells and I'm getting the error message, "The selection contains
multiple data values. Merging into one cell will keep the upper-left most
data only." I want to be able to make the two seperate cells one without
deleting anything and without having to cut and paste.

  #26  
Old December 13th, 2008, 03:09 AM posted to microsoft.public.excel.misc
J9
external usenet poster
 
Posts: 17
Default How do I merge two cells without deleting data from the cell?

is it the same formula for all the rows...it keeps repeating the same thing
all the way down...an ideas?

"Batmans_Wife" wrote:

Thank you so much for sending me this formula. It worked perfectly and did
exactly what I needed. I really appreciate your quick, helpful response.

Sincerely,
Michelle

"Peo Sjoblom" wrote:

You can't, you can concatenate 2 cells into one by using a formula and
ampersand

=A1&" "&B1


however stay away from merging cells, always cause more problems than what
it's worth and layout wise you can get very close without using it. I have
never seen a power user using merging

Regards,

Peo Sjoblom

"Batmans_Wife" wrote:

I'm highlighting two cells in the same row, hitting format cells, alignment,
merge cells and I'm getting the error message, "The selection contains
multiple data values. Merging into one cell will keep the upper-left most
data only." I want to be able to make the two seperate cells one without
deleting anything and without having to cut and paste.

  #27  
Old December 13th, 2008, 03:15 AM posted to microsoft.public.excel.misc
J9
external usenet poster
 
Posts: 17
Default How do I merge two cells without deleting data from the cell?

what if you wanted to do multiple rows?

"anthony561fl" wrote:

This works great. However, what if Im wanting to combine several columns, say
50 or 100 columns worth of data? Id hate to have to enter each cell name in
that formula. Is there a way to specify a range of columns or cells rather
than each one before and after ampersands?



"Peo Sjoblom" wrote:

You can't, you can concatenate 2 cells into one by using a formula and
ampersand

=A1&" "&B1


however stay away from merging cells, always cause more problems than what
it's worth and layout wise you can get very close without using it. I have
never seen a power user using merging

Regards,

Peo Sjoblom

"Batmans_Wife" wrote:

I'm highlighting two cells in the same row, hitting format cells, alignment,
merge cells and I'm getting the error message, "The selection contains
multiple data values. Merging into one cell will keep the upper-left most
data only." I want to be able to make the two seperate cells one without
deleting anything and without having to cut and paste.

  #28  
Old December 13th, 2008, 05:59 PM posted to microsoft.public.excel.misc
Gord Dibben
external usenet poster
 
Posts: 20,252
Default How do I merge two cells without deleting data from the cell?

Browse through these postings to which you tacked onto.

http://tinyurl.com/599r3q

Make sure that your calculation mode is set to automatic so's you don't get
same results all the way down.


Gord Dibben MS Excel MVP

On Fri, 12 Dec 2008 18:15:02 -0800, j9 wrote:

what if you wanted to do multiple rows?

"anthony561fl" wrote:

This works great. However, what if Im wanting to combine several columns, say
50 or 100 columns worth of data? Id hate to have to enter each cell name in
that formula. Is there a way to specify a range of columns or cells rather
than each one before and after ampersands?



"Peo Sjoblom" wrote:

You can't, you can concatenate 2 cells into one by using a formula and
ampersand

=A1&" "&B1


however stay away from merging cells, always cause more problems than what
it's worth and layout wise you can get very close without using it. I have
never seen a power user using merging

Regards,

Peo Sjoblom

"Batmans_Wife" wrote:

I'm highlighting two cells in the same row, hitting format cells, alignment,
merge cells and I'm getting the error message, "The selection contains
multiple data values. Merging into one cell will keep the upper-left most
data only." I want to be able to make the two seperate cells one without
deleting anything and without having to cut and paste.


  #29  
Old January 7th, 2009, 06:15 PM posted to microsoft.public.excel.misc
AcousticVin
external usenet poster
 
Posts: 1
Default How do I merge two cells without deleting data from the cell?

The formula worked perfectly for me as well...thanks for the post.

"Peo Sjoblom" wrote:

You can't, you can concatenate 2 cells into one by using a formula and
ampersand

=A1&" "&B1


however stay away from merging cells, always cause more problems than what
it's worth and layout wise you can get very close without using it. I have
never seen a power user using merging

Regards,

Peo Sjoblom

"Batmans_Wife" wrote:

I'm highlighting two cells in the same row, hitting format cells, alignment,
merge cells and I'm getting the error message, "The selection contains
multiple data values. Merging into one cell will keep the upper-left most
data only." I want to be able to make the two seperate cells one without
deleting anything and without having to cut and paste.

  #30  
Old January 15th, 2009, 09:09 PM posted to microsoft.public.excel.misc
MK
external usenet poster
 
Posts: 87
Default How do I merge two cells without deleting data from the cell?


try instead of a1&" "$b1":
$A1&" "&$B1
then drag/fill the cell however many rows/cols you want to do

the "$" makes it absolute and fill wont change the valu immediatly preceded
by the "$" so "A" and "B" will never change but "1" in both cases will

"anthony561fl" wrote:

This works great. However, what if Im wanting to combine several columns, say
50 or 100 columns worth of data? Id hate to have to enter each cell name in
that formula. Is there a way to specify a range of columns or cells rather
than each one before and after ampersands?



"Peo Sjoblom" wrote:

You can't, you can concatenate 2 cells into one by using a formula and
ampersand

=A1&" "&B1


however stay away from merging cells, always cause more problems than what
it's worth and layout wise you can get very close without using it. I have
never seen a power user using merging

Regards,

Peo Sjoblom

"Batmans_Wife" wrote:

I'm highlighting two cells in the same row, hitting format cells, alignment,
merge cells and I'm getting the error message, "The selection contains
multiple data values. Merging into one cell will keep the upper-left most
data only." I want to be able to make the two seperate cells one without
deleting anything and without having to cut and paste.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple docs, one data source kp Mailmerge 12 January 31st, 2005 05:41 PM
Pulling data from 1 sheet to another Dave1155 Worksheet Functions 1 January 12th, 2005 06:55 PM
How do I get 3 series in sync with the x-axis? zizbird Charts and Charting 10 October 25th, 2004 01:23 PM
Is this possible with Excel Chart? q582gmzhi Charts and Charting 1 September 8th, 2004 03:33 AM
How to run word and pass a mail merge values and fax it to the recipient Belinda Mailmerge 2 June 13th, 2004 12:49 AM


All times are GMT +1. The time now is 10:13 AM.


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