Solved

Manipulate Data Quickly

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

856 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