+ Reply to Thread
Results 1 to 4 of 4

Macro or VBA to Transpose Forecast from Columns to Rows as shown

Hybrid View

  1. #1
    Registered User
    Join Date
    03-08-2018
    Location
    NY
    MS-Off Ver
    2010
    Posts
    5

    Macro or VBA to Transpose Forecast from Columns to Rows as shown

    Hello,

    I'm looking to take the data from the "Data" tab and transpose into the rows as show on the "Transpose" tab. I only need ITEM, DATE and QTY's as shown. I'm not sure if a macro or a VBA is best suited for scenario? Any help is most appreciated.
    Attached Files Attached Files
    Last edited by playtowin; 12-24-2020 at 11:01 AM.

  2. #2
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,957

    Re: Macro or VBA to Transpose Forecast from Columns to Rows as shown

    Hi there playtowin...

    Welcome to the Forum...Here's one way...
    Sub sintekJ3v16()
    Dim Data, Temp(), i As Long, ii As Long, x As Long
    With Sheet1.Cells(6, 1).CurrentRegion
        Data = .Value
        ReDim Temp(1 To UBound(Data, 1) * UBound(Data, 2), 1 To 3)
        For i = 1 To UBound(Data)
            If Not i = 1 Then
                For ii = 7 To UBound(Data, 2)
                    x = x + 1
                    Temp(x, 1) = Data(i, 1): Temp(x, 2) = Data(1, ii): Temp(x, 3) = Data(i, ii)
                Next ii
            End If
        Next i
    End With
    Sheet2.Range("A3").Resize(x, 3) = Temp
    End Sub
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    03-08-2018
    Location
    NY
    MS-Off Ver
    2010
    Posts
    5

    Re: Macro or VBA to Transpose Forecast from Columns to Rows as shown

    You are awesome! Thank you so much!

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,957

    Re: Macro or VBA to Transpose Forecast from Columns to Rows as shown

    .........................
    Thanks.png

+ 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. [SOLVED] Macro to transpose rows into columns and paste to specific columns in another sheet
    By LDLDLD in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-05-2019, 11:08 AM
  2. VBA Macro to transpose the rows to columns
    By skallamp in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-03-2018, 09:55 AM
  3. [SOLVED] Macro to convert Data for Months shown in Rows to Columns
    By prkhan56 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2015, 02:27 PM
  4. Macro to transpose rows to columns
    By escodc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-25-2013, 03:15 PM
  5. [SOLVED] Macro to Transpose variable columns into rows
    By Awalgaonkar in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-18-2013, 01:11 PM
  6. [SOLVED] Macro to Transpose Columns Into Rows
    By boldcode in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-02-2011, 04:44 PM
  7. Macro to transpose a set of rows to columns
    By romanzy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-17-2010, 06:45 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