Feb 12 2021 10:24 AM
Column A has same value but column B has different value .
e.g. 236445 has 3 different email ID . can some one help me to put those columns in different columns
236445 | karthik.shekar@test.co.in | |||||
236445 | vikram.shetty@test.co.in | |||||
236445 | murugesan.shanmugam@test.co.in | |||||
210406 | gagan.desai@test.co.in | |||||
210406 | vikram.shetty@test.co.in | |||||
210406 | sujith.vijayan@test.co.in | |||||
210406 | jeevesh.mehta@test.co.in | |||||
210406 | mithun.vesuwala@test.co.in | |||||
210406 | rakesh.kartemp@test.co.in | |||||
I need it as below . Can anyone help ? | ||||||
236445 | karthik.shekar@test.co.in | |||||
236445 | murugesan.shanmugam@test.co.in | |||||
210406 | gagan.desai@test.co.in | |||||
210406 | vikram.shetty@test.co.in | |||||
210406 | sujith.vijayan@test.co.in | |||||
210406 | jeevesh.mehta@test.co.in | |||||
210406 | mithun.vesuwala@test.co.in | |||||
210406 | rakesh.kartemp@test.co.in |
Feb 12 2021 12:05 PM
Here is a macro:
Sub MoveB()
Dim r As Long
Dim m As Long
Dim c As Long
Application.ScreenUpdating = False
m = Cells(Rows.Count, 1).End(xlUp).Row
c = 2
For r = 2 To m
If Cells(r, 1).Value = Cells(r - 1, 1).Value Then
c = c + 1
Cells(r, 2).Cut Destination:=Cells(r, c)
Else
c = 2
End If
Next r
' Optional
ActiveSheet.UsedRange.EntireColumn.AutoFit
Application.ScreenUpdating = True
End Sub
Feb 14 2021 10:47 PM
@Hans Vogelaar can this be possible on excel ? I do not know macros
Feb 15 2021 12:36 AM
Press Alt+F11 to activate the Visual Basic Editor.
Select Insert > Module to create a new code module.
Copy the code from my previous reply and paste it into the module.
With the insertion point anywhere in the code, press F5 to run the macro.
Switch back to Excel to view the result.
If you want to keep the macro, save the workbook as a macro-enabled workbook (.xlsm)