+ Reply to Thread
Results 1 to 4 of 4

Transpose one column into multiple rows

Hybrid View

abrown1017 Transpose one column into... 08-02-2013, 12:38 PM
patel45 Re: Transpose one column into... 08-02-2013, 01:00 PM
HaHoBe Re: Transpose one column into... 08-02-2013, 01:34 PM
abrown1017 Re: Transpose one column into... 08-02-2013, 01:51 PM
  1. #1
    Registered User
    Join Date
    08-02-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    2

    Transpose one column into multiple rows

    I need to transpose one column of data into multiple rows. The only problem is that there is not a set number of records. It can vary. The only way to identify then end of the records is by the phone number. I have tried multiple macros on my own, and I can't get it to work. Please use SNA records.xlsm That is the most recent.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Transpose one column into multiple rows

    need a sample file with source data and desired result
    If solved remember to mark Thread as solved

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Transpose one column into multiple rows

    Hi, abrown1017,

    the code can transpose but it can´t fill in into the adequate columns as the headers/identifiers are missing.

    Sub EF944428()
    Dim rngStart As Range
    Dim rngEnd As Range
    Dim wsData As Worksheet
    Dim wsNew As Worksheet
    Dim lngTarget As Long
    
    Set wsNew = Worksheets.Add
    Set wsData = Sheets("Sheet1")
    
    Set rngStart = wsData.Range("A1")
    Do While rngStart.Row < wsData.Range("A" & Rows.Count).End(xlUp).Row
      Set rngEnd = wsData.Columns(1).Find(what:="(", after:=rngStart, lookat:=xlPart)
      If Not rngEnd Is Nothing Then
        wsData.Range(rngStart, rngEnd).Copy
        lngTarget = lngTarget + 1
        wsNew.Range("A" & lngTarget).PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:=False, Transpose:=True
        Set rngStart = rngEnd.Offset(1, 0)
      Else
        MsgBox "Can´t find the telephone for " & rngStart.Value, vbInformation, "Exit Sub"
        Exit Sub
      End If
    Loop
    End Sub
    @patel45
    need a sample file with source data and desired result
    Opening post hasn´t been edited so the file was there with the data and the result before your helpfull post - what else do you need?

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Registered User
    Join Date
    08-02-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Transpose one column into multiple rows

    The code you sent me worked great. That is all I needed! Thank you so much

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to transpose column A to Multiple rows?
    By lyanneryan in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-18-2013, 07:51 AM
  2. [SOLVED] How to transpose one column into multiple rows and columns?
    By Raoul Gonzo in forum Excel General
    Replies: 4
    Last Post: 01-15-2013, 11:00 AM
  3. How can I transpose multiple rows into one column.
    By Doodie in forum Excel General
    Replies: 5
    Last Post: 12-16-2012, 08:47 AM
  4. Transpose multiple rows into one column
    By lucidglassj in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-17-2011, 11:04 AM
  5. Multiple Transpose from Same column to different rows and colums.
    By marc5354 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-20-2010, 06:14 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1