pile-it Mark
Board Regular
- Joined
- Jan 10, 2006
- Messages
- 125
i have a code that functions great. after testing i realized i need it to clear contents below row 3.
row 1 is headings, row 2 is formulas, row 3 is a blank buffer, i would like to keep the format, but that could be ignored.
and i would need to tell my code to start posting on line 4
I am very new at VBA. 5 days learning so far. everything i have is copy and paste. with lots of help from this site, Yahoo, and trials. now i cant find the code that i read that discussed this. and doubt i could figure out where to place it if i found it.
Thanks
row 1 is headings, row 2 is formulas, row 3 is a blank buffer, i would like to keep the format, but that could be ignored.
and i would need to tell my code to start posting on line 4
I am very new at VBA. 5 days learning so far. everything i have is copy and paste. with lots of help from this site, Yahoo, and trials. now i cant find the code that i read that discussed this. and doubt i could figure out where to place it if i found it.
Thanks
Code:
Option Explicit
Sub Copy1stRow()
' hiker95, 01/15/2014, ME750730 Default Re: copy of a single row from multiple worksheets into summary sheet within the same workbook
' modified by pile-it Mark with help from Ashutosh Kumar 01/06/2017
Dim ws As Worksheet, nr As Long
For Each ws In ThisWorkbook.Worksheets
If Not ws.Name = "2017 TOTALS" _
And Not ws.Name = "distance table" _
And Not ws.Name = "Flight Log 2017 Original" _
And Not ws.Name = "Summary" _
And Not ws.Name = "Master" _
And Not ws.Name = "vba test" Then
nr = Sheets("2017 TOTALS").Range("A" & Rows.Count).End(xlUp).Offset(1).Row
ws.Rows(1).Copy
Sheets("2017 TOTALS").Rows(nr).PasteSpecial Paste:=xlPasteValues
End If
Next ws
End Sub