You are here:

Excel/Copy Last row of each sheet to 1 sheet.

Advertisement


Question
Hi Dave,

My destination sheet is called Master Data.

I would like to Copy and paste the last row of each sheet and paste into Master Data first empty row.

Thanks,
Paul

Answer
Hi Paul,

Give this a go.

Sub LoopThroughSheets()

  Dim shts As Worksheet
  Dim Ws As Worksheet

  Set Ws = Worksheets("Master Data")

  For Each shts In Sheets

      If shts.Name <> Ws.Name Then

        With shts

        .Cells(Rows.Count, "A").End(xlUp).EntireRow.Copy _
        Ws.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)

        End With

      End If

  Next shts

End Sub

About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Dave Morrison

Expertise

I can answer most excel questions My Website is davesexcel.com

Experience

I have been working with spreadsheets since 1991. I am a self-trained excel developer since 2005.

Publications
My website davesexcel.com

Education/Credentials
Business admin. U of R.

Awards and Honors
Microsoft Excel MVP 2011-2012

©2016 About.com. All rights reserved.