Solved

Manipulate Data Quickly

Posted on 2016-11-23
2
22 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

920 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now