Formatting an unorganized data

shekhar_pc

Board Regular
Joined
Jan 29, 2006
Messages
185
ask.xls
BCDEFGHIJKLMN
6ABCDAA-99904:0505:0507:0502:00143 :TOM P(C1)631 :**** S(C2)
7ABC-DEF1030 :HARRY GA(C2)
81211 :JULIE (C2)
9ABCDAA-88804:0505:0507:0502:00543 :TIM P(C1)1131 :JOHN S(C2)
10GHI-JKL6030 :BOB(C2)
116211 :VIC M(C2)
Sheet1
ask.xls
BCDEFG
6ABCDAA-99904:0505:0502:00143 :TOM P(C1)
7ABC-DEF07:05631 :**** S(C2)
81030 :HARRY GA(C2)
91211 :JULIE (C2)
10ABCDAA-88804:0505:0502:00543 :TIM P(C1)
11GHI-JKL07:051131 :JOHN S(C2)
126030 :BOB(C2)
136211 :VIC M(C2)
Sheet2


I have my RAW data in Sheet1 in the range B6:N11 (Actual data would be at B6:Nxx, where xx is not known) . I have to format the RAW data in such a way that it looks like in figure 2 posted above which should be formatted in sheet2 in the range (B6:Gxx)

I have recorded a macro and tweaked it a little bit which gives me a similar answer but not the perfect one that I want. Also my recorded macro is too big. Can anyone help me with this?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Code:
Sub test()
Dim x As Range, firstaddress As String
With Range("B:B")
Set x = .Find("ABCD", Range("B" & Rows.Count), LookIn:=xlFormulas, LookAt _
    :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
    False, SearchFormat:=False)
If Not x Is Nothing Then
    firstaddress = x.Address
    Do
        'Your Code Here
        Set x = .FindNext(x)
    Loop While Not x Is Nothing And x.Address <> firstaddress
End If
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,533
Messages
6,114,179
Members
448,554
Latest member
Gleisner2

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