Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Merge multiple cells

Hi,

I would like to know, how can I merge multiple cells without loosing
the value and have a space between them.

Example: if A1=Text1, if A2=text2, if A3=text3, if A4=text4

Then I select with my mouse A1 to A4 and I apply a merge then I get in
the same cell: text1 text2 Text3 text4

Anyone know how to do such thing ?

Thank you,

Adi,


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Merge multiple cells

You could create a procedure to do it. I think the following will do what
you want

Sub MergeAndCombine()

Dim curCell As Object
Dim strText As String

For Each curCell In Selection
strText = strText & curCell.Value & " "
curCell.Value = ""
Next

ActiveCell.Value = RTrim(strText)

Selection.HorizontalAlignment = xlCenter
Selection.Merge


End Sub


Sue
"gasma1975 " wrote in message
...
Hi,

I would like to know, how can I merge multiple cells without loosing
the value and have a space between them.

Example: if A1=Text1, if A2=text2, if A3=text3, if A4=text4

Then I select with my mouse A1 to A4 and I apply a merge then I get in
the same cell: text1 text2 Text3 text4

Anyone know how to do such thing ?

Thank you,

Adi,


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Merge multiple cells

If you want to merge a lot of cells in columns on a row by row bases
see MergeRxR_Join macro in
http://www.mvps.org/dmcritchie/excel/merge.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm



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
merge info from multiple cells sahlicat Excel Discussion (Misc queries) 1 January 19th 10 08:09 PM
Merge multiple cells LJoe Excel Worksheet Functions 8 May 25th 07 01:05 AM
Merge Multiple Cells Carter68 Excel Discussion (Misc queries) 2 February 8th 06 03:11 PM
How do I merge cells with multiple data values? KatMic Excel Discussion (Misc queries) 2 November 28th 05 10:13 PM
merge multiple row cells of text corresponding to one row of data roberta t williams Excel Worksheet Functions 0 August 12th 05 04:09 PM


All times are GMT +1. The time now is 03:10 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"