LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

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.







 
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
difficulty with conditional formatting Deb Excel Discussion (Misc queries) 0 March 23rd 05 06:13 PM
conditional formatting question Deb Excel Discussion (Misc queries) 0 March 23rd 05 02:07 AM
Formatting dates in the future Compass Rose Excel Worksheet Functions 3 January 17th 05 10:39 PM
Copy conditional formatting across multiple rows? Gil Excel Discussion (Misc queries) 1 January 11th 05 11:27 AM
Conditional formatting not available in Excel BAB Excel Discussion (Misc queries) 2 January 1st 05 03:33 PM


All times are GMT +1. The time now is 08:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"