View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Excel should merge cells without removing content of any cell

Try selecting your range and running this:

Option Explicit
Sub testme02()

Dim myRng As Range
Dim myArea As Range

Set myRng = Selection

Application.DisplayAlerts = False
For Each myArea In myRng.Areas
If myArea.Columns.Count 1 Then
myArea.Merge across:=True
End If
Next myArea
Application.DisplayAlerts = True

End Sub


It merges each row separate from the other rows.

Rumpa Biswas wrote:

Hi Dave,
Thanks for your reply. I am not aware of the fact that macros can be used
for merging cells without removing any content.
If you have any such macro ready with you, it will be nice if you please
share with me.

"Dave Peterson" wrote:

How should it join the values in the now merged cells.

Should it use the text that you see?

1234.00 formatted as $1,234.00 or keep it as the value in the cell. (Remember
that dates can be formatted lots of different ways, too.)

Should it have a space between each value or should it just jam things
together? Or maybe add alt-enters between each value.

If you're always merging the cells the same way, you could create a macro that
did what you wanted with the values in that area to be merged.

Then just select that range to merge and execute the macro.

Rumpa Biswas wrote:

In MS Excel, when we merge cells, content of only one cell exists.

But is MS word, in a table, we can merger any number of cells without
removing content of any cell.

If this feature is dependant on certain settings, please let me know.

Otherwise, it will be good to introduce this functionality in MS Excel also.

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...lic.excel.misc


--

Dave Peterson


--

Dave Peterson