+ Reply to Thread
Results 1 to 5 of 5

Sorting Data - copy only needed data (macro)

Hybrid View

  1. #1
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Sorting Data - copy only needed data (macro)

    Sub ertert()
    Dim x, i&, j&, k&
    With Sheets("Sheet1")
        x = .Range("A1:K" & .Cells(Rows.Count, 1).End(xlUp).Row).Value
    End With
    
    For i = 1 To UBound(x)
        If x(i, 1) Like "Employee:*" Then
            j = j + 1: x(j, 1) = Trim(Split(x(i, 1), ":")(1))
        End If
        If x(i, 1) Like "Total of*" Then
            For k = 3 To UBound(x, 2): x(j, k - 1) = x(i, k): Next k
        End If
    Next i
    
    Sheets("Sheet2").Range("B2:K2").Resize(j).Value = x
    End Sub
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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