+ Reply to Thread
Results 1 to 4 of 4

transpose column to a range calculate and transpose to new table loop

Hybrid View

  1. #1
    Registered User
    Join Date
    04-05-2013
    Location
    new york, new york
    MS-Off Ver
    Excel 2010
    Posts
    19

    transpose column to a range calculate and transpose to new table loop

    hi

    This must be basic but i'm drawing a blank. i have a table with data that i need to transpose each coumn into a row that calculates the results and then to transpose the results to a new table. also it would be preferable that if the sum of column "n" is "0" the loop sould stop and fill the next columns "n+1..." of the new table with 0's. attatched is a sample of the file.
    Attached Files Attached Files

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: transpose column to a range calculate and transpose to new table loop

    Try this simple code:
    Sub test()
    Dim i As Long
    For i = 2 To 7
      Cells(17, 2).Resize(1, 10).Value = Application.WorksheetFunction.Transpose(Cells(4, i).Resize(10, 1))
      Application.Calculate
      Cells(4, i + 8).Resize(10, 1).Value = Application.WorksheetFunction.Transpose(Range("B18:K18"))
    Next i
    End Sub
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    04-05-2013
    Location
    new york, new york
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: transpose column to a range calculate and transpose to new table loop

    kaper thanks for the reply, the macro wont work becouse i should have clarified that i need the transposed numbers to be a formula becouse they feed a what if data table and if they would be hard cosded i wont get any new simulations. is there a way to get the columns transposed but keeping the columns as a reference?

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: transpose column to a range calculate and transpose to new table loop

    Well, I probably do not really follow your idea, but let's try another approach:


    Sub test2()
    Dim i As Long, j As Long
    Range("J4:O13").ClearContents
    For i = 2 To 7
      For j = 4 To 13
        Cells(j, i + 8).Formula = "=" & Cells(j, i).Address & Mid(Cells(18, j - 2).Formula, InStr(Cells(18, j - 2).Formula, "*"))
    Next j, i
    End Sub

+ 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. Transpose Data from a Particular Column to Multiple Column whose Range is Non-Continuous!
    By Rajeshkumar R in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2014, 05:47 AM
  2. transpose column in to table format
    By rojy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-17-2012, 03:39 AM
  3. how to transpose row data into column wise into new table in access
    By alpeshkpatel in forum Access Programming / VBA / Macros
    Replies: 1
    Last Post: 10-13-2012, 09:03 AM
  4. Transpose range into table
    By ElmerS in forum Excel General
    Replies: 2
    Last Post: 07-19-2010, 04:35 PM
  5. [SOLVED] transpose a range to a single column
    By Jeff in forum Excel General
    Replies: 7
    Last Post: 06-15-2006, 09:55 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