ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Search and Combine Rows (https://www.excelbanter.com/excel-worksheet-functions/445598-search-combine-rows.html)

ktemplin

Search and Combine Rows
 
I have a spreadsheet that has multiple rows and two Colums. A1 =
Server name, B1 = email address of the server owner. The problem is
that servers have multiple owners so one server could have 7 rows.
What I would like to do is to concatinate all the email addresses, so
I have one row per server.
For example here is the existing data:
Row = Column1, Column2
Row 1 = Server1,
Row 2 = Server1,

Row 3 = Server1,

Row 4 = Server1,

Row 5 = Server2,

Row 6 = Server2,

Row 7 = Server3,


What I would like to have is:
Row 1 = Server1,
; ;
;
Row 2 = Server2,
;
Row 3 = Row 7 = Server3,


I am not familiar with macros, is there any way of doing this with
functions?

Don Guillett[_2_]

Search and Combine Rows
 
On Monday, March 26, 2012 10:20:30 AM UTC-5, ktemplin wrote:
I have a spreadsheet that has multiple rows and two Colums. A1 =
Server name, B1 = email address of the server owner. The problem is
that servers have multiple owners so one server could have 7 rows.
What I would like to do is to concatinate all the email addresses, so
I have one row per server.
For example here is the existing data:
Row = Column1, Column2
Row 1 = Server1,
Row 2 = Server1,

Row 3 = Server1,

Row 4 = Server1,

Row 5 = Server2,

Row 6 = Server2,

Row 7 = Server3,


What I would like to have is:
Row 1 = Server1,
; ;
;
Row 2 = Server2,
;
Row 3 = Row 7 = Server3,


I am not familiar with macros, is there any way of doing this with
functions?

Sub blockstorowsSAS()
Dim i As Long
Dim lc As Long

On Error Resume Next
For i = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
If Cells(i + 1, 1) = Cells(i, 1) Then
lc = Cells(i, Columns.Count).End(xlToLeft).Column + 1
Cells(i + 1, 2).Resize(, lc).Copy Cells(i, lc)
Rows(i + 1).Delete
End If
Next i
Columns.AutoFit
End Sub

Vacuum Sealed

Search and Combine Rows
 
On 27/03/2012 2:20 AM, ktemplin wrote:
I have a spreadsheet that has multiple rows and two Colums. A1 =
Server name, B1 = email address of the server owner. The problem is
that servers have multiple owners so one server could have 7 rows.
What I would like to do is to concatinate all the email addresses, so
I have one row per server.
For example here is the existing data:
Row = Column1, Column2
Row 1 = Server1,
Row 2 = Server1,

Row 3 = Server1,

Row 4 = Server1,

Row 5 = Server2,

Row 6 = Server2,

Row 7 = Server3,


What I would like to have is:
Row 1 = Server1,
; ;
;
Row 2 = Server2,
;
Row 3 = Row 7 = Server3,


I am not familiar with macros, is there any way of doing this with
functions?


Row = Column3

=Column1&","&Column2

HTH
Mick.


Vacuum Sealed

Search and Combine Rows
 
On 27/03/2012 8:08 AM, Vacuum Sealed wrote:
On 27/03/2012 2:20 AM, ktemplin wrote:
I have a spreadsheet that has multiple rows and two Colums. A1 =
Server name, B1 = email address of the server owner. The problem is
that servers have multiple owners so one server could have 7 rows.
What I would like to do is to concatinate all the email addresses, so
I have one row per server.
For example here is the existing data:
Row = Column1, Column2
Row 1 = Server1,
Row 2 = Server1,

Row 3 = Server1,

Row 4 = Server1,

Row 5 = Server2,

Row 6 = Server2,

Row 7 = Server3,


What I would like to have is:
Row 1 = Server1,
; ;
;
Row 2 = Server2,
;
Row 3 = Row 7 = Server3,


I am not familiar with macros, is there any way of doing this with
functions?


Row = Column3

=Column1&","&Column2

HTH
Mick.

D'oh

Pays to read the post in it's entirety.....
Holiday Mode...:)

What Don has posted is what you need ....

Mick.

Gord Dibben[_2_]

Search and Combine Rows
 
That's no fun<g


Gord

On Tue, 27 Mar 2012 08:10:46 +1100, Vacuum Sealed
wrote:

D'oh

Pays to read the post in it's entirety...



All times are GMT +1. The time now is 10:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com