Autofilter VBA - Defaults to US date format

EdwardSurrey

New Member
Joined
May 13, 2015
Messages
36
Office Version
  1. 365
Platform
  1. Windows
Hello! I have made a VBA to autofilter based on a date in cell D5. The problem is I'm in the UK and it's taking dates such as 01/04/2022 to mean 04/01/2022. Is there a ways to force it to recognise the British date format?

Sub DateFilter()
'
' DateFilter Macro
'
ActiveSheet.Range("$A$15:$L$300").AutoFilter Field:=10, Criteria1:=">=" & Worksheets("Win Loss Report").Range("D5").Value, Operator:=xlAnd
End Sub


Is there any easy fix? Thanks in advance :)
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Use .Value2 rather than .Value. That will return the date as a number rather than a date, and that can't be misinterpreted.
 
Upvote 0
Solution
Use .Value2 rather than .Value. That will return the date as a number rather than a date, and that can't be misinterpreted.

I'm amazed at how fast you responded to me. I have much to learn! Thank you :)
 
Upvote 0
Glad we could help. :)
 
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,435
Members
448,961
Latest member
nzskater

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