+ Reply to Thread
Results 1 to 4 of 4

Data Arrangement

Hybrid View

Excel_Pa Data Arrangement 10-19-2015, 09:49 AM
jindon Re: Data Arrangement 10-19-2015, 10:50 AM
Excel_Pa Re: Data Arrangement 10-20-2015, 06:14 AM
jindon Re: Data Arrangement 10-20-2015, 06:27 AM
  1. #1
    Registered User
    Join Date
    02-21-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    64

    Data Arrangement

    Kindly advise,

    Attached excel sheet for your reference. Thanks in advance.

    The blue colour heading's data downloaded from intranet.
    This is the raw data
    The information run with very details which is not required. No filter to select the required information



    The Green colour heading's data arranged manually i.e., copy & paste the data.

    Solution:
    Are there any way we can simplify without mannual copy & paste the data.
    Chances are there copying will go error and Total amount does not match.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Data Arrangement

    This should work for the data provided.
    Sub test()
        Dim myAreas As Areas, i As Long
        Application.ScreenUpdating = False
        With Sheets("data")
            With .Range("a2", .Range("d" & Rows.Count).End(xlUp)(0))
                .Value = Application.Trim(.Value)
                Set myAreas = .Columns(1).SpecialCells(4).Areas
            End With
            .Rows(2).Resize(, 8).Copy .Range("j2")
            For i = 1 To myAreas.Count
                myAreas(i)(0).Resize(, 8).Copy .Range("j" & i + 2)
                With myAreas(i).Offset(, 3).SpecialCells(2)
                    .Areas(.Areas.Count).Resize(, 5).Copy .Parent.Range("m" & i + 2)
                End With
            Next
            Range("d" & Rows.Count).End(xlUp).EntireRow.Resize(, 8).Copy
            With .Range("j" & i + 2)
                .PasteSpecial
                .PasteSpecial xlValues
            End With
        End With
        Application.ScreenUpdating = True
    End Sub
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-21-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    64

    Re: Data Arrangement

    Hi Jindon,

    Thanks for you help.

    I need macro to coy Col-9 & Col-10 data and pasted to after Col-8
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Data Arrangement

    Change to
    Sub test()
        Dim myAreas As Areas, i As Long, cols As Long
        Application.ScreenUpdating = False
        With Sheets("data")
            With .Range("a2", .Range("d" & Rows.Count).End(xlUp)(0))
                cols = .CurrentRegion.Columns.Count
                .Value = Application.Trim(.Value)
                Set myAreas = .Columns(1).SpecialCells(4).Areas
            End With
            .Rows(2).Resize(, cols).Copy .Cells(2, cols + 2)
            For i = 1 To myAreas.Count
                myAreas(i)(0).Resize(, cols).Copy .Cells(i + 2, cols + 2)
                With myAreas(i).Offset(, 3).SpecialCells(2)
                    .Areas(.Areas.Count).Resize(, 8).Copy .Parent.Cells(i + 2, cols + 5)
                End With
            Next
            Range("d" & Rows.Count).End(xlUp).EntireRow.Resize(, cols).Copy
            With .Cells(i + 2, cols + 2)
                .PasteSpecial
                .PasteSpecial xlValues
            End With
        End With
        Application.ScreenUpdating = True
    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. Data arrangement
    By akumagaavese in forum Excel General
    Replies: 1
    Last Post: 03-13-2015, 04:12 PM
  2. Data arrangement
    By akumagaavese in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-13-2015, 02:59 PM
  3. Help with data arrangement
    By dayne in forum Excel General
    Replies: 11
    Last Post: 06-01-2011, 10:14 AM
  4. data arrangement
    By tofimoon4 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 07-14-2010, 03:08 AM
  5. Data re-arrangement
    By SCT in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-19-2009, 06:09 AM
  6. Data arrangement
    By kushalprakash in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-19-2006, 05:05 AM
  7. Data Arrangement
    By tbobo in forum Excel General
    Replies: 3
    Last Post: 03-23-2006, 10:50 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