Results 1 to 5 of 5

how to change axis of excel table?

This is a discussion on how to change axis of excel table? within the Excel Questions forums, part of the Question Forums category; I want to change my axis on my excel table. BEFORE: name | age | town bob | 24 | ...

  1. #1
    Board Regular
    Join Date
    Feb 2007
    Posts
    74

    Default how to change axis of excel table?

    I want to change my axis on my excel table.

    BEFORE:

    name | age | town
    bob | 24 | london
    john | 30 | crewe

    AFTER

    name | bob | john
    age | 24 | 30
    town | london | crewe

    I know there's a simple way to do it but cant remember...

  2. #2
    MrExcel MVP
    Moderator
    SydneyGeek's Avatar
    Join Date
    Aug 2003
    Location
    Sydney, Australia
    Posts
    12,203

    Default Re: how to change axis of excel table?

    If there aren't any formulas in the table:

    Copy
    Select blank cell below the table
    Edit > Paste Special > Transpose

    Denis
    Self-preservation: For when you've got yourself in a jam
    ------------------------------------------------------
    My site contains a number of Excel and Access Resources

  3. #3
    Board Regular
    Join Date
    May 2009
    Location
    Texas, USA
    Posts
    1,288

    Default Re: how to change axis of excel table?

    Builts new table i second sheet

    Code:
     
    Option Explicit
    Sub ConvertColumnsToRows()
    Dim c As Range
    Dim col As Integer
    col = 1
    For Each c In Range("A1", Range("A65536").End(xlUp))
    Sheets("Sheet2").Cells(1, col) = c
    col = col + 1
    Next c
    col = 1
    For Each c In Range("B1", Range("B65536").End(xlUp))
    Sheets("Sheet2").Cells(2, col) = c
    col = col + 1
    Next c
    col = 1
    For Each c In Range("C1", Range("C65536").End(xlUp))
    Sheets("Sheet2").Cells(3, col) = c
    col = col + 1
    Next c
    End Sub
    Bill
    Use Option Explicit to avoid chasing code.

  4. #4
    Board Regular
    Join Date
    May 2009
    Location
    Texas, USA
    Posts
    1,288

    Default Re: how to change axis of excel table?

    I forgot about the transpose feature
    Good call SydneyGeek
    Bill
    Use Option Explicit to avoid chasing code.

  5. #5
    Board Regular
    Join Date
    Feb 2007
    Posts
    74

    Default Re: how to change axis of excel table?

    works great, thanks.

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com