Copying data from Table but omitting header row

WxShady13

Board Regular
Joined
Jul 24, 2018
Messages
185
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
Code:
Sub CopyTables()
    Worksheets("SHMM Sections").Range("A3:G300").ClearContents
Dim lastrow As Long
   lastrow = Cells(Rows.Count, "G").End(xlUp).Row
    Range("A2:A" & lastrow).Copy
    Sheets("Sign-In Sheet").Select
    Range("A2").Select
    Worksheets("SHMM Sections").Range("A3").Paste
    
End Sub



I am working on copying data from one table into another table on a different worksheet. I can copy the table however the header comes in. The code below should omit the header, however it will not paste in the worksheet I have defined. Where am I going wrong?
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Try:
Code:
Sub CopyMe()
Dim x as Long
Dim arr() as Variant
With Sheets("SHMM Sections")
  x = .Cells(.Rows.Count, 1).End(xlUp).Row
  .Cells(3,1).resize(x,7).ClearContents
End With
With ActiveSheet
  x = .Cells(.Rows.Count, 1).End(xlUp).Row
  arr = .cells(2, 1).Resize(x - 1).Value
End With
Sheets("SHMM Sections").Cells(3,1).Resize(Ubound(arr, 1)).value = arr
erase arr

End Sub
 
Upvote 0
Thank you for the reply...This code just returns the word Badge # in the SHMM Sections worksheet. I am copying from Sign-On Sheet in columns A through G with the rows being determined by how many students attend the course. It is writing to SHMM Sections worksheets.
 
Upvote 0

Forum statistics

Threads
1,223,959
Messages
6,175,645
Members
452,663
Latest member
MEMEH

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