Run-time error 1004 Copy and Paste

Sherifa

New Member
Joined
Oct 23, 2017
Messages
45
I have tried a number of different variations to copy and paste but they are not working.
I keep experiencing a run time error.

Rich (BB code):
Sub Filter()






Dim Wkb As Excel.Workbook
Dim ws As Sheets
Dim i As Long
Dim LastRow As Long
Dim LastRow1 As Long
Dim Rng As Range
Dim deleteRange As Range
 
Set Wkb = ThisWorkbook
Set ws = ThisWorkbook.Worksheets
ws_count = Wkb.Worksheets.Count


Sheets("MYA Dump").Activate
LastRow = Wkb.Worksheets("MYA Dump").Cells(Rows.Count, 1).End(xlUp).Row


    
LastRow1 = Wkb.Worksheets("MYA Dump").Cells(Rows.Count, 1).End(xlUp).Row


ActiveSheet.Range("$A$5:$gh$" & LastRow1).AutoFilter Field:=12, Criteria1:="CGMFL"
ActiveSheet.Range("$A$5:$gh$" & LastRow1).AutoFilter Field:=18, Operator:= _
        xlFilterValues, Criteria2:=Array(0, "12/31/2018")




Sheets("MYA Dump").Activate
Sheets("MYA Dump").Range("A:gh").SpecialCells(xlCellTypeVisible).Copy


Sheets("2018 Raw Data").Activate
Sheets("2018 Raw Data").Range("e:gl").ClearContents
Sheets("2018 Raw Data").Range("e:gl").Selection
Sheets("2018 Raw Data").Range("e:gl").SpecialCells(xlCellTypeVisible).Paste
    'A:DPasteDown




End Sub
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,214,587
Messages
6,120,406
Members
448,958
Latest member
Hat4Life

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