Solved

transpose range of cells in excel 2007

Posted on 2011-09-09
5
248 Views
Last Modified: 2012-05-12
Dear experts
I know how to trasnpose a column in a row and vice versa, what I want to do in this case, without using vb script if possible is to take a column exported from my property database which simply has a gap (empty cell) between each record and move that as a whole chunk across as a row. This is because the mail merge merge program in Word (2007) only seems to import the field headers as a row, unless someone can tell me how to mail merge from that layout instead it would acheive the same thing.
Fro example, I have 3 records all on column A, the first 2 contain 4 rows and the last one is 5 rows, how would I get this trasnposed into 3 columns using the empty cell between each reacord as a delimiter, or I could insert a delimiter character in between each record such as a tab or comma if that would make it easier.
Your help is much appreciated.
0
Comment
Question by:revahi
5 Comments
 

Author Comment

by:revahi
ID: 36509069
Apologies for my spelling, I rushed this Q out in a hurry without previewing first! I trust it's still understood otherwise please query and I will correct.
thank you
0
 
LVL 24

Expert Comment

by:StephenJR
ID: 36509285
Could you post a small sample workbook?
0
 
LVL 19

Accepted Solution

by:
akoster earned 500 total points
ID: 36509321
I am not sure if it could be done without using VB, but with a macro it is fairly easy, assuming that you start with an empty worksheet and copy the records to column A
Sub process()

    target_row = 1
    target_col = 3
    For Row = 1 To UsedRange.Rows.Count

        If Range("A" & Row) = "" Then
            '-- empty cell = delimiter, move to new column
            target_row = 1
            target_col = target_col + 1
        Else
            target_row = target_row + 1
            Cells(target_row, target_col) = Range("A" & Row)
        End If

    Next Row

End Sub

Open in new window



0
 
LVL 24

Expert Comment

by:broomee9
ID: 37169473
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

910 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

21 Experts available now in Live!

Get 1:1 Help Now