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

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Logit

Well-known Member
Joined
Aug 31, 2016
Messages
4,320
Has anyone come across something similar.

Yes. I had to re-write the exact code into the new version of Excel (not copy and paste).
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,126
Messages
5,768,263
Members
425,460
Latest member
Astros1243

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
Top