Pasting 3 blank rows for some reason

WxShady13

Board Regular
Joined
Jul 24, 2018
Messages
184
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
First off I know the code is messy but I have tried so many things that I am just lost at this point. I have a workbook and a user pastes values into a table (Table3, Sign-In Sheet). After running the Macro (CopyTable) the data from Table3 should copy over to SHMM Sections and from there to CBT Modules. What ends up happening is the copy function currently adds 3 blank lines at the bottom which messes up the subsequent worksheets. I cannot figure out where the blank lines are coming from with the copy. I have stopped the code and verified that it is only highlighting the Table3 data lines.

Code:
Sub CopyTable()
Sheets("SHMM Sections").Unprotect Password:="Brock1234"
'Worksheets("SHMM Sections").Range("A3:CS200").deleteRows
With Worksheets("SHMM Sections").ListObjects("Table4")
        If Not .DataBodyRange Is Nothing Then
            .DataBodyRange.Delete
        End If
End With
Call DeleteCBTRows
Worksheets("Sign-In Sheet").Activate
Dim lastRow As Long
lastRow = Range("C" & Rows.Count).End(xlUp).Row
Worksheets("Sign-In Sheet").Range("A7:D" & lastRow).Copy
Worksheets("SHMM Sections").Range("A3:CS" & lastRow).PasteSpecial xlPasteValues
'Worksheets("SHMM Sections").Activate
lastRow = Range("A" & Rows.Count).End(xlUp).Row
Worksheets("SHMM Sections").Range("A3:D" & lastRow).Copy
Worksheets("CBT Modules").Range("A2:D" & lastRow).PasteSpecial xlPasteValues
Call AutoFill
'Worksheets("SHMM Sections").Range("A3").PasteSpecial = xlPasteValues
Call IFStatements
Sheets("SHMM Sections").Protect Password:="Brock1234"
End Sub
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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