Solved

transpose range of cells in excel 2007

Posted on 2011-09-09
5
247 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
Comment Utility
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
Comment Utility
Could you post a small sample workbook?
0
 
LVL 19

Accepted Solution

by:
akoster earned 500 total points
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

771 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

9 Experts available now in Live!

Get 1:1 Help Now