View Single Post
 
Old 02-18-2015, 09:38 PM
Brian Reilly Brian Reilly is offline Windows 8 Office 2013
Novice
 
Join Date: Jan 2014
Posts: 3
Brian Reilly is on a distinguished road
Default copy second row from multiple sheets

Option Explicit
Sub Copy2ndRow()
Dim ws As Worksheet, nr As Long
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "MTD" Then
nr = Sheets("MTD").Range("A" & Rows.Count).End(xlUp).Offset(1).Row
ws.Rows(2).Copy Sheets("MTD").Rows(nr)
End If
Next ws
End Sub

Hello -
My goal is to copy A2:P2 from 31 daily sheets to MTD sheet and sum all columns.... the code above does everything I need except formatting - I would like to paste values only but keep getting an error when I try to add the code below

.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

also would like to have this run whenever the workbook is closed

Thank you in advance

Brian
Reply With Quote