Solved

Manipulate Data Quickly

Posted on 2016-11-23
2
28 Views
Last Modified: 2016-11-23
Hi, is there a quick way to manipulate data when it is in this sort of format? (see attached)

I have 7 workbooks where the data is spread out like this and I need to find a fast way to get the data into a tabular format. So basically 'name', 'phone', 'street' and 'suburb' are all column headings and the data falls below that.

Thanks
Troy
TAS-Dentists.xlsx
0
Comment
Question by:recycleaus
2 Comments
 
LVL 33

Accepted Solution

by:
Norie earned 500 total points
ID: 41899801
Troy

Give this a try.
Sub GoTabular()
Dim arrIn As Variant
Dim arrOut As Variant
Dim I As Long
Dim J As Long
Dim cnt As Long

    arrIn = Sheets("Sheet1").UsedRange.Columns(2)
    
    ReDim arrOut(1 To UBound(arrIn, 1) / 5, 1 To 4)

    For I = LBound(arrIn, 1) To UBound(arrIn, 1) Step 5
        cnt = cnt + 1
        For J = 1 To 4
            arrOut(cnt, J) = arrIn(I + J - 1, 1)
        Next J
    Next I
    
    Sheets.Add
    
    Range("A1:D1").Value = Array("Name", "Phone", "Street", "Suburb")
    
    Range("A2").Resize(UBound(arrOut, 1), UBound(arrOut, 2)).Value = arrOut
    
End Sub

Open in new window

0
 

Author Closing Comment

by:recycleaus
ID: 41899802
I found another solution myself in the end but thanks for the quick response.
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question