+ Reply to Thread
Results 1 to 5 of 5

vb macros code to convert rows into columns one after other

Hybrid View

Dharani Suresh vb macros code to convert... 08-08-2013, 04:52 AM
patel45 Re: vb macros code to convert... 08-08-2013, 05:53 AM
Dharani Suresh Re: vb macros code to convert... 08-11-2013, 05:30 AM
Leon V (AW) Re: vb macros code to convert... 08-08-2013, 06:08 AM
Dharani Suresh Re: vb macros code to convert... 08-11-2013, 05:30 AM
  1. #1
    Forum Contributor
    Join Date
    07-23-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    106

    vb macros code to convert rows into columns one after other

    Respected Sir/Madam,

    In the attached excel sheet, I need, all the left side rows namely jan, feb, ...dec. of all the years to be appeared like right hand side columns. That is., rows has to be converted into columns one by one (which I have done manually for your kind reference) please write VB macros coding for this and help me…
    Kindly find the attachment…
    Like this I have to do for 100 files. Please help me I have to submit this very urgently...

    Please oblige and do the needful…
    Thanks & Regards,
    Dharani.
    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: vb macros code to convert rows into columns one after other

    Sub Macro1()
    LR = Cells(Rows.Count, "A").End(xlUp).Row
    dcol = 34
    For j = 1 To LR Step 13
      drow = 2
      Cells(1, dcol) = Cells(j, 1)
      For r = j + 1 To j + 12
        Range("A" & r & ":AF" & r).Copy
        Cells(drow, dcol).Select
        Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
            False, Transpose:=True
        drow = drow + 32
      Next
      dcol = dcol + 1
    Next
    End Sub
    If solved remember to mark Thread as solved

  3. #3
    Forum Contributor
    Join Date
    07-23-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: vb macros code to convert rows into columns one after other

    Dear Patel,
    Thank you for the wonderful coding.. its amazingly working... thank for the immediate response... my heartfelt thanks to you..

    Thanks & Regards,
    Rena
    Last edited by arlu1201; 08-12-2013 at 04:24 AM. Reason: Removed whole post quote.

  4. #4
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    365
    Posts
    330

    Re: vb macros code to convert rows into columns one after other

    This will turn Rows in one sheet into Columns on another
    Sub test()
    Dim lastr As Integer, lastc As Integer
    Dim cell As Range
    Dim RowsSheet As String
    RowsSheet = ActiveSheet.Name
    lastr = ActiveSheet.UsedRange.Rows.Count
    lastc = ActiveSheet.UsedRange.Columns.Count
    
    Sheets.Add(After:=Sheets(Sheets.Count)).Name = "columnsSheet"
    Worksheets(RowsSheet).Activate
    For Each cell In Worksheets(RowsSheet).Range(Cells(1, 1), Cells(lastr, lastc)).Cells
        Worksheets("ColumnsSheet").Cells(cell.Column, cell.Row) = cell
    Next cell
    Worksheets("ColumnsSheet").Activate
    End Sub

  5. #5
    Forum Contributor
    Join Date
    07-23-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: vb macros code to convert rows into columns one after other

    Dear Leon,
    Thank you for the wonderful coding.. its amazingly working... thank for the immediate response... my heartfelt thanks to you..

    Thanks & Regards,
    Rena
    Last edited by arlu1201; 08-12-2013 at 04:24 AM. Reason: Removed whole post quote.

+ 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 Convert Columns of Sheet 1 to Rows of Sheet 2 using Macros
    By Rintil007 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-31-2013, 10:15 AM
  2. Replies: 1
    Last Post: 11-29-2012, 06:24 PM
  3. Using macros or code to unhide columns.
    By steven.leitheiser in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-11-2011, 06:11 AM
  4. to convert columns to rows having mulit independent group columns
    By Quacy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-22-2006, 06:25 PM
  5. Convert code rows to columns
    By Piranha in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-13-2005, 01:05 AM

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