Not pasting into 1st row of table

Status
Not open for further replies.

WxShady13

Board Regular
Joined
Jul 24, 2018
Messages
184
Office Version
  1. 365
Platform
  1. Windows
  2. 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
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Duplicate to: VBA Code not pasting to top row of Table

In future, please do not post the same question multiple times. Per Forum Rules (#12), posts of a duplicate nature will be locked or deleted.

In relation to your question here, I have closed this thread so please continue in the linked thread. If you do not receive a response, you can "bump" it by replying to it yourself, though we advise you to wait 24 hours before doing so, and not to bump a thread more than once a day.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,214,893
Messages
6,122,121
Members
449,066
Latest member
Andyg666

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top