Merging two cells within the same table
I'm assuming there are two rows of data for every line. If not how can I
tell when there are two line or one line for each entry. Your posting had --
in column A. iI this really true? If ther are two line for every entry then
use code below.
Sub CombineRows()
RowCount = 1
Do While Range("B" & RowCount) < ""
NextAddress = Trim(Range("B" & (RowCount + 1)))
Range("B" & RowCount) = _
Range("B" & RowCount) & NextAddress
Rows(RowCount + 1).Delete
RowCount = RowCount + 1
Loop
End Sub
"Phia" wrote:
I have a spreadsheet of data that I export from a database. The problem is
that Excel interprets each data row as a hard return, instead of keeping that
test together. Example:
name address phone number
Jill 555 1212 555-555-555
-- Palasades dr.
Instead of keeping the address in once cell, it splits it into two rows.
When I do a sort, all the data is then moved out of context and is valid.
What I am trying to do is Merge the two rows, Palasades dr. and 555 1212 into
one cell. When I try to do this manually, the Palasades dr. text is deleted.
I've found scripts that merge cells by columns, but none that merge by rows.
Any help would be wonderful!
Think of all the beauty still around you and be happy-Anne Frank
Sophia
|