Results 1 to 5 of 5

Macro to Reorganize Data

Threaded View

  1. #1
    Registered User
    Join Date
    12-09-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007
    Posts
    4

    Macro to Reorganize Data

    Good Afternoon everyone,

    I am working to have attached sheet1 look like attached sheet2. The code I currently have is below. Please bear with me as I am not used to doing anything with excel macros, I am a Crystal Report Dev.

    I am looking to have the numbers pull over also.

    The code I have....half *** thrown together: (any tips or suggestions would be greatly appreciated)

    Sub ifail()
    
        Application.ScreenUpdating = False
        
     Sheets("Sheet1").Select
             Last = Cells(Rows.Count, "B").End(xlUp).Row
        For i = Last To 1 Step -1
            If (Cells(i, "B").Value) <> "Action Type" And (Cells(i, "B").Value) <> "EventsCompleted" And (Cells(i, "B").Value) <> "ProcessClosed" And (Cells(i, "B").Value) <> "ReprojectionsCreated" And (Cells(i, "B").Value) <> "HoldsEnded" Then
            Cells(i, "A").EntireRow.Delete
            End If
        Next i
        
        
        
        Sheets("Sheet2").Select
        Range("A3").Select
        Selection.Font.Bold = True
        ActiveCell.FormulaR1C1 = "Employee"
        Range("B3").Select
        Selection.Font.Bold = True
        ActiveCell.FormulaR1C1 = "Events Completed"
        Range("C3").Select
        Selection.Font.Bold = True
        ActiveCell.FormulaR1C1 = "Process Closed"
        Range("D3").Select
        Selection.Font.Bold = True
        ActiveCell.FormulaR1C1 = "Reprojections"
        Range("E3").Select
        Selection.Font.Bold = True
        ActiveCell.FormulaR1C1 = "Holds Created"
        Range("F3").Select
        Selection.Font.Bold = True
        ActiveCell.FormulaR1C1 = "Tasks Completed"
        
        Sheets("Sheet2").Select
        Range("A4").Select
        
        Sheets("Sheet1").Select
        Range("A1").Select
        Selection.End(xlDown).Select
        
        Do Until IsEmpty(ActiveCell)
            Sheets("Sheet1").Select
            Selection.Copy
            Sheets("Sheet2").Select
            ActiveSheet.Paste
            Selection.Offset(1, 0).Select
            Sheets("Sheet1").Select
            Selection.End(xlDown).Select
        Loop
        
    
        
        Cells.Select
        Cells.EntireColumn.AutoFit
        
    Application.ScreenUpdating = True
    End Sub
    Attached Files Attached Files
    Last edited by Korbrm; 12-12-2011 at 12:09 PM.

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