Results 1 to 17 of 17

Transferring data from several worksheets to one "summary" worksheet in the same workbook

Threaded View

  1. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Transferring data from several worksheets to one "summary" worksheet in the same workb

    I ran the macro below.

    See the attached file.

    Sub integratie_Oeldere_revisted_vs3()
    
    'I got a lot of help from AB33, to get this code working; thanks for that AB33.
    
    Dim wsTest As Worksheet
    
    'check if sheet "Consolidated" already exist
    
    Const strSheetName As String = "Consolidated"
     
    Set wsTest = Nothing
    On Error Resume Next
    Set wsTest = ActiveWorkbook.Worksheets(strSheetName)
    On Error GoTo 0
     
    If wsTest Is Nothing Then
        Worksheets.Add.Name = strSheetName
    End If
    
    With Sheets("Consolidated")
        .UsedRange.ClearContents
        .Range("A1:E1").Value = Array("sheet", "CODE", "HRS", "RATE", "AMOUNT")
        For Each Sh In Sheets
            With Sh
                If .Name <> "Consolidated" Then
                     LR = .Cells(.Rows.Count, 9).End(xlUp).Row
                    If LR >= 2 Then
                       Rng = .Cells.Find("*", , , , xlByRows, xlPrevious).Row - 1
                       NR = Sheets("Consolidated").Cells.Find("*", , , , xlByRows, xlPrevious).Row + 1
                       If Rng > 0 Then
                        Sheets("Consolidated").Cells(NR, 1).Resize(Rng) = .Name
                        Sheets("Consolidated").Cells(NR, 2).Resize(Rng, 4) = .Range("I4").Resize(Rng, 4).Value
                      End If
                   End If
                End If
            End With
        Next
        On Error Resume Next
        .Range("e2:e" & .Rows.Count).SpecialCells(4).EntireRow.Delete
        .Columns("A:Z").EntireColumn.AutoFit
    End With
    End Sub
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Run Macros on all except "Summary" and "Reports" worksheets in a workbook
    By daralea in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2013, 05:42 PM
  2. [SOLVED] 2 workbooks transferring cell data from workbook1 to workbook 2 (when cell has "art" in it
    By garfield8626 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2013, 02:36 PM
  3. [SOLVED] Need Macro to compile data from "Weekly" sheets and sum up into "Monthly" summary sheet
    By mo4391 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-21-2013, 07:25 PM
  4. [SOLVED] Consolidating "Select Worksheets" in a Workbook into a Consolidated Worksheet
    By tecmkr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-25-2012, 12:53 PM
  5. [SOLVED] Transferring date from multiple worksheets to a "totals" worksheet.
    By tonyDeBrasco in forum Excel General
    Replies: 3
    Last Post: 07-22-2005, 01:05 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