+ Reply to Thread
Results 1 to 8 of 8

Need cut and paste data from multiple sheets to one master sheet

Hybrid View

  1. #1
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need cut and paste data from multiple sheets to one master sheet

    Sub CombineAllSheets()
     Dim ms As Worksheet, LRms As Long, ws As Worksheet, LR As Long, rng As Long, i As Long
     
        Application.ScreenUpdating = 0
        Application.DisplayAlerts = 0
        
        On Error Resume Next
        
        If Not Evaluate("ISREF(Master!A1)") Then
            Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Master"
        Else
            Set ms = Sheets("Master")
            Sheets("Master").Range("A2:D" & Rows.Count).ClearContents
        End If
         
         Worksheets(1).Rows(1).Copy ms.Range("A1")
         
     For Each ws In Worksheets
        With ws
            If .Name <> "Master" Then
                LR = .Cells.Find("*", , , , xlByRows, xlPrevious).Row
                .Range("A2:D" & LR).Cut ms.Range("A" & ms.Range("A:P").Find(What:="*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row + 1).Resize(, 16)
                 
            End If
        End With
     Next ws
         
         Application.CutCopyMode = 0
         
         Application.ScreenUpdating = 1
        
         Application.DisplayAlerts = 1
    End Sub
    Last edited by AB33; 01-06-2013 at 06:45 PM.

  2. #2
    Registered User
    Join Date
    01-04-2013
    Location
    dayton ohio
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Need cut and paste data from multiple sheets to one master sheet

    Thank you. Here is another scenario. I want to cut and paste data on the first three tabs only to the master worksheet. But I only want to copy the rows that have a value in column A. The next procedure is after the data are pasted, this time delete the value from range E2:H5 only. Again, thanks for your help.
    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