Merge duplicate rows into one!

MACEOCH

New Member
Joined
May 25, 2015
Messages
2
Hi guys,

I'm doing some medical research and I'm having difficulty arranging my excel data. I'm sure what I need done is very straightforward but I'm still only learning the basics of excel so I was wondering if someone wouldn't mind taking a quick look!

My Data is arranged in two columns as follows-

A1
A2
A3
B4
B5
C6
D7
E8
E9
E10

<tbody>
</tbody>


and I need to rearrange it so it looks like the following:
A123
B45
C6
D7
E8910

<tbody>
</tbody>


I'm sure this can't be too difficult! I played around at it for about an hour but to be honest I think I'm stumped!
Thanks a million.

Dr C
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Try this:-
Results Start "F1"
Code:
[COLOR="Navy"]Sub[/COLOR] MG25May07
[COLOR="Navy"]Dim[/COLOR] Rng [COLOR="Navy"]As[/COLOR] Range, Dn [COLOR="Navy"]As[/COLOR] Range
[COLOR="Navy"]Dim[/COLOR] Q [COLOR="Navy"]As[/COLOR] Variant, n [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
[COLOR="Navy"]Dim[/COLOR] Ray(), oMax [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
[COLOR="Navy"]Set[/COLOR] Rng = Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))
   [COLOR="Navy"]With[/COLOR] CreateObject("scripting.dictionary")
            .CompareMode = vbTextCompare
    [COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] Dn [COLOR="Navy"]In[/COLOR] Rng
        [COLOR="Navy"]If[/COLOR] Not .Exists(Dn.Value) [COLOR="Navy"]Then[/COLOR]
            n = n + 1
            ReDim Preserve Ray(1 To Rng.Count, 1 To n)
            .Add Dn.Value, Array(2, n)
                Ray(1, n) = Dn.Value
                Ray(2, n) = Dn.Offset(, 1)
        [COLOR="Navy"]Else[/COLOR]
            Q = .Item(Dn.Value)
               Q(0) = Q(0) + 1
               Ray(Q(0), Q(1)) = Dn.Offset(, 1)
               oMax = Application.Max(oMax, Q(0))
            .Item(Dn.Value) = Q
        [COLOR="Navy"]End[/COLOR] If
    [COLOR="Navy"]Next[/COLOR]
Range("F1").Resize(n, oMax) = Application.Transpose(Ray)
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]With[/COLOR]
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0

Forum statistics

Threads
1,203,205
Messages
6,054,140
Members
444,703
Latest member
pinkyar23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top