rotate a spreadsheet in excel or access

Discussion in 'OT Technology' started by michelin man, Jul 15, 2003.

  1. michelin man

    michelin man IDB Construction

    Joined:
    Jul 22, 2001
    Messages:
    11,714
    Likes Received:
    17
    Location:
    Austin
    i need to rotate a spreadsheet.

    how can i do it excel or access ??
     
  2. Fantik

    Fantik Guest

    write java program to do it using buffered readers ^_^
     
  3. Fantik

    Fantik Guest

    and string tokenizers
     
  4. Fantik

    Fantik Guest

    filewriters, oh my.
     
  5. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,522
    Likes Received:
    7
    Location:
    Vancouver, BC, CANADA
    Could you provide an example so the best solution can be given?
     
  6. Fantik

    Fantik Guest

    I don't have an example, but Ill try to quickly explain this before my meeting.

    well first export the excel sheet to a tab deliminated text file.
    then in your java program using a bufferedReader and a StringTokenizer, read the data in and save it to a String[][] (with the same dimentions as your excel file)

    say your array is
    String a = new String[x][y]
    you'll need to create another String, but with the dimensions
    String b = new String[y][x] (this should be easy enough to see because you are just going to invert the axis of the array.)

    Then
    for (int j=0; j<a[0].length() // this will be the width of the first String[][]; j++)
    {
    for(int i = 0; i<a.length(); /*(this will be the length of the first string[][]).*/ i++)
    {
    b[j] = a[j];
    }
    }

    then write out your new array using a tab delimited file writer.
    then import that into excel.

    sorry if this chickenscratch is hard to understand, if you don't get what I mean, ask me. I'll come back after my meeting.
     
  7. michelin man

    michelin man IDB Construction

    Joined:
    Jul 22, 2001
    Messages:
    11,714
    Likes Received:
    17
    Location:
    Austin
    the data looks like this
    [​IMG]


    and i need it to look like this


    [​IMG]
     
  8. JimboJones

    JimboJones Guest

    You can do this without programming at all.
    Select the data and edit\copy.
    Then select a new area (or sheet) to paste it to and select edit\paste special.
    In the dialog box that comes up,
    select the check box at the bottom that says tranpose.
    That should get you where you want to be.
     
  9. Early Apex

    Early Apex Guest

    Damn, beat me to it. Paste Special: Transpose
     
  10. michelin man

    michelin man IDB Construction

    Joined:
    Jul 22, 2001
    Messages:
    11,714
    Likes Received:
    17
    Location:
    Austin
    i just found it on another site..... thanks for the help

    --------
    1. Select ALL the cells you want to copy and Copy

    2. Select a new sheet and activate A1

    3. Edit/Paste Special - check the Transpose Checkbox - OK

    ---------
     
  11. Fantik

    Fantik Guest

    meh. I'm still going to write the program and post the source code for it when I get home.

    i'm a dork
     
  12. Early Apex

    Early Apex Guest

    Why would you do it in Java? Excel VBA lets you do the same thing without having to export/import data.
     
  13. Fantik

    Fantik Guest

    because I like java
     
  14. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,522
    Likes Received:
    7
    Location:
    Vancouver, BC, CANADA
    and because he's a dork
     

Share This Page