View Single Post
  #11   Report Post  
adin
 
Posts: n/a
Default

This works like a charm. You get the cookie.

Thanks for your assitance!

"Bob Phillips" wrote:

God-darn, why don't you tell me what you want at the start (vbg

Sub MoveData()
Dim iLastRow As Long
Dim i As Long

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 2 Step -1
If Cells(i, "A").Value = Cells(i - 1, "A").Value Then
Cells(i - 1, "B").Value = Cells(i - 1, "B").Value & _
Chr(10) & Cells(i, "B").Value
Cells(i, "A").EntireRow.Delete
End If
Next i
Columns(2).WrapText = True

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"adin" wrote in message
...
Looks good!

Now here's the fun part - I'd like to add a carriage return after each

value
instead of a space so that each value is on top of one another within the
same cell. I can't seem to locate the carriage return charater(s)

anywhere.



"Bob Phillips" wrote:

It's easy to adapt, like so

Sub MoveData()
Dim iLastRow As Long
Dim i As Long

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 2 Step -1
If Cells(i, "A").Value = Cells(i - 1, "A").Value Then
Cells(i - 1, "B").Value = Cells(i - 1, "B").Value & _
Cells(i, "B").Value
Cells(i, "A").EntireRow.Delete
End If
Next i

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"adin" wrote in message
...
It worked, except it put each of the values from column B into their

own
cells in subsequent columns. I sorta need those values in the same

cell.

I do, however, appreciate your efforts.


"Bob Phillips" wrote:

Yep!

Sub MoveData()
Dim iLastRow As Long
Dim i As Long

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 2 Step -1
If Cells(i, "A").Value = Cells(i - 1, "A").Value Then
Cells(i, "B").Resize(1, 25).Copy Destination:=Cells(i -

1,
"C")
Cells(i, "A").EntireRow.Delete
End If
Next i

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"adin" wrote in message
...
I'd like this:

Column A Column B
A 1
A 2
A 3
A 4
B 1
B 2
C 1
D 1

to look like:

A 1 2 3 4
B 1 2
C 1
D 1

The numbers should be in the same cell, not different columns.

Easy, right?

Thanks.