Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB Macro for concatenating data...
Hi all, I have a spreadsheet along the following lines: Id Attrib 1 Attrib 2 Attrib 3 ... 1 x 1 x 1 x 2 x 2 x 3 x 3 x I need to 'condense' this, i.e. reduce the replication of information- represent the binary flags under 1 id: Id Attrib 1 Attrib 2 Attrib 3 ... 1 x x x 2 x x 3 x x Is this doable by VB macro? I have tired all sorts of other ways of manipulating the data, but I am stuck using excel and would greatly appreciate any help someone might give me. Thanks in advance! -- rivvorz ------------------------------------------------------------------------ rivvorz's Profile: http://www.excelforum.com/member.php...o&userid=33450 View this thread: http://www.excelforum.com/showthread...hreadid=532584 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB Macro for concatenating data...
Sub Test()
Dim iLastRow As Long Dim iLastCol As Long Dim i As Long Dim j 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 iLastCol = Cells(i, Columns.Count).End(xlToLeft).Column For j = 2 To iLastCol If Cells(i, j).Value < "" Then Cells(i - 1, j).Value = Cells(i, j).Value End If Next j Rows(i).Delete End If Next i End Sub -- HTH Bob Phillips (remove nothere from email address if mailing direct) "rivvorz" wrote in message ... Hi all, I have a spreadsheet along the following lines: Id Attrib 1 Attrib 2 Attrib 3 ... 1 x 1 x 1 x 2 x 2 x 3 x 3 x I need to 'condense' this, i.e. reduce the replication of information- represent the binary flags under 1 id: Id Attrib 1 Attrib 2 Attrib 3 ... 1 x x x 2 x x 3 x x Is this doable by VB macro? I have tired all sorts of other ways of manipulating the data, but I am stuck using excel and would greatly appreciate any help someone might give me. Thanks in advance! -- rivvorz ------------------------------------------------------------------------ rivvorz's Profile: http://www.excelforum.com/member.php...o&userid=33450 View this thread: http://www.excelforum.com/showthread...hreadid=532584 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
concatenating | Excel Worksheet Functions | |||
Need Macro for concatenating multiple worksheet | Excel Discussion (Misc queries) | |||
Concatenating % | Excel Discussion (Misc queries) | |||
After concatenating data, how do I get Excel to recognise date? | Excel Discussion (Misc queries) | |||
Concatenating | New Users to Excel |