Reputation: 1813
I have 3 columns in a sheet in excel as below
I need the output in the below format on a SEPARATE SHEET
I'm fine with either VB script or using just excel features. Could I please get some help?
Upvotes: 0
Views: 190
Reputation: 35915
Try this macro. Place the macro in a regular code module (Insert > Module). Adjust the ranges to suit your situation.
Sub rearrange()
Dim cel As Range, tgt As Range
Set cel = ActiveSheet.Range("A1")
Set tgt = ActiveSheet.Range("D1")
Do While Len(cel) > 0
tgt = cel
tgt.Offset(1, 0) = cel.Offset(0, 1) & cel.Offset(0, 2)
Set cel = cel.Offset(1, 0)
Set tgt = tgt.Offset(2, 0)
Loop
ActiveSheet.Range("A:C").Delete
End Sub
Upvotes: 1
Reputation: 5582
If you're not going to do this on a regular basis, here's a simple solution.
I don't have access to MS-Excel so I cannot give you the exact answer. But I hope this helps.
Steps:
=Concatenate(b1,c1)
and keep this result in cell D1. Do a copy-paste of the function for the other rows as well.If you need to do this regularly, this method is not suitable. You'll be better off with a VBA script. But it's been a very long time since I worked on Excel so I cannot help you there.
Upvotes: 0