WxShady13
Board Regular
- Joined
- Jul 24, 2018
- Messages
- 184
- Office Version
- 365
- Platform
- Windows
- Mobile
Why is it when I run this macro does it not start at the first row of the BalanceTable (A6)? It pastes in A7 which then doesnt extend the table. What am I missing?
VBA Code:
Sub Copy_Sheets_To_Master()
Call ClearBalanceTables
Dim wb As Workbook
Dim ws As Worksheet
Dim i, LastRowa, LastRowd As Long
Dim WSname As String
Set wb = ActiveWorkbook
For Each ws In wb.Sheets
If ws.Name <> "Balance Tables" Then
If ws.Name <> "Monthly Amount Due" Then
If ws.Name <> "Main" Then
If ws.Name <> "Key" Then
If ws.Name <> "Mail Merge-SNAIL" Then
If ws.Name <> "Mail Merge-EMAIL" Then
If ws.Name <> "VLOOKUP DATA" Then
If ws.Name <> "Payroll Table" Then
If ws.Name <> "Payment Log" Then
If ws.Name <> "Balance" Then
If ws.Name <> "VLOOKUP Rates" Then
If ws.Name <> "Master" Then
WSname = ws.Name
'With ActiveSheet
ws.Cells(Rows.Count, 1).End(xlUp).EntireRow.Copy
'End With
'LastRowa = ws.Cells(Rows.Count, "A").End(xlUp).Row
LastRowd = Sheets("Balance Tables").Cells(Rows.Count, "A").End(xlUp).Row
'ws.Range("A6" & LastRowa).EntireRow.Copy
Sheets("Balance Tables").Range("A6" & LastRowd + 1).PasteSpecial Paste:=xlPasteValues
'Sheets("Balance Tables").Range("A" + 1).PasteSpecial Paste:=xlPasteValues
'Sheets("Master").Range("A" & LastRowd + 1).Value = WSname
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
Next ws
End Sub