+ Reply to Thread
Results 1 to 7 of 7

move data from diff rows in 1 column into new columns based on dup data in another field

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: move data from diff rows in 1 column into new columns based on dup data in another fie

    the file "lxndeb 140730.xlsm" is attached
    download the file, open, enable macros

    the data is in sheet1 and result will be in sheet2.
    the macro is module 1 of vbeditor of the file and also repeated below

    Sub test()
    Dim nname As Range, unq As Range, cunq As Range, rdata As Range
    Dim dest As Range, rname As String
    Application.ScreenUpdating = False
    Worksheets("sheet2").Cells.Clear
    With Worksheets("sheet1")
    Set rdata = .Range("A1").CurrentRegion
    Set unq = .Range("A1").End(xlDown).Offset(5, 0)
    Set nname = Range(.Range("A1"), .Range("A1").End(xlDown))
    nname.AdvancedFilter xlFilterCopy, , unq, True
    Set unq = Range(unq.Offset(1, 0), unq.End(xlDown))
    For Each cunq In unq
    rname = cunq
    rdata.AutoFilter field:=1, Criteria1:=cunq
    rdata.Offset(1, 0).Resize(rdata.Rows.Count - 1).SpecialCells(xlCellTypeVisible).Columns(2).Copy
    With Worksheets("sheet2")
    Set dest = .Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
    dest = rname
    dest.Offset(0, 1).PasteSpecial Transpose:=True
    End With
    .AutoFilterMode = False
    Next cunq
    Range(unq.Offset(-1, 0), unq.End(xlDown)).Cells.Clear
    End With
    MsgBox "macro done SEE SHEET2"
    Application.ScreenUpdating = True
    End Sub
    Attached Files Attached Files
    I am not an expert. better solutions may be available
    $$$$venkat1926$$$$@gmail.com

+ 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] Move coulumns data of a sheet to diff other columns of other sheet in same workbook
    By ROHAN999 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 09-03-2013, 09:22 AM
  2. Move data in rows to columns based on unique ID in column A
    By ssdsibes in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-04-2013, 07:04 AM
  3. Move Rows of Data from a Specific Column (Based on Matching Criteria) to a new Sheet
    By jordan1214 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-21-2013, 02:30 AM
  4. [SOLVED] Fill formula in column with data taken from diff columns
    By SergSlim in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-31-2012, 10:32 AM
  5. How to move data in Column A into seperate columns / rows
    By iain.sanderson@wanadoo.fr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2006, 11:00 PM

Tags for this Thread

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