Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Public Sub Group()
Dim a$, b$, i& ' starting with A1 but you can change it below With Range("A1") a$ = .Value b$ = .Offset(0, 1).Value i = .Row + 1: j = .Column End With next_a$ = Cells(i, j).Value next_b$ = Cells(i, j + 1).Value While next_a$ < "" Rows(i).Select If ((a = next_a) And (b = next_b)) Then Cells(i - 1, j + 2).Value = Cells(i - 1, j + 2).Value & "/" & Cells(i, j + 2).Value Rows(i).Delete Else a = next_a b = next_b i = i + 1 End If next_a$ = Cells(i, j).Value next_b$ = Cells(i, j + 1).Value Wend End Sub |
#2
![]() |
|||
|
|||
![]()
abcd
That was on the money. Many thanks and great bit of code. Cheers, Mike |
#3
![]() |
|||
|
|||
![]()
ok but just note that the
Rows(i).Select was onlu for test purpose, no need to it |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"Query cannot be edited by the Query Wizard" | Excel Discussion (Misc queries) | |||
Excel2000 ODBC query oddity | Excel Discussion (Misc queries) | |||
Query of External Data | Excel Discussion (Misc queries) | |||
Microsoft Query Help | Excel Worksheet Functions | |||
How to use a Access Query that as a parameter into Excel database query | Excel Discussion (Misc queries) |