VBA stopped working

Alan64

New Member
Joined
May 16, 2019
Messages
13
Hi, I have been running a script for a number of years, we have recently been updated to 365 and part of the script no longer works. The script used to place an auto filter on to a page of data and filter to set parameters the copy filtered data and paste into different sheet within the same work book. It is the copy and paste that seems to have stopped working. Has anyone come across something similar.
Application.StatusBar = "GENERATE LIST OF LICENSES DUE TO EXPIRE"

Sheets("Import").Select

'Range("A1").Select
'Selection.AutoFilter
'ActiveSheet.Range("A:I").AutoFilter field:=9, Criteria1:=Expiry_Date, Operator:=xlAnd

Dim StartDate As Date
Dim EndDate As Date
StartDate = Date
EndDate = Date + 42
ActiveSheet.Range("I1:I5000").AutoFilter Field:=1, Criteria1:=">=" & CDbl(StartDate), Operator:=xlAnd, Criteria2:="<=" & CDbl(EndDate)
Range("A1:I5000").Select
Selection.Copy
Sheets("Due to Expire").Select
Range("A1").Select
ActiveSheet.Paste
Cells.EntireColumn.AutoFit
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,212,927
Messages
6,110,695
Members
448,293
Latest member
jin kazuya

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