VBA to Change Date Format

srj1359

New Member
Joined
Mar 5, 2015
Messages
46
Office Version
  1. 2016
Platform
  1. Windows
Hello! I work for a global company and have a workbook used by colleagues in multiple countries. Is there a way to write VBA for a popup so that the date format changes based on the user's country? Ex: in the United States, we write December 18, 2020 and 12/18/20, but other regions write 18/12/20. Any assistance you can provide is greatly appreciated! Thank you,
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
The date should appear on a user's pc according to their country setting on their equipment. The date value is a long integer and the default format that is displayed as the short date, (ie. mm/dd/yyyy) is determined by the system setting through Control Panel. You should not have to be conserned about the display format. However, it does not automatically convert literal dates used in code, so you have to be careful about how you express dates in the code.

This link might be helpful: How To: Regional Date Formats in Excel Update: December 2020 Microsoft Excel Tips • Excel Semi-Pro
 
Last edited:
Upvote 0
Solution

Forum statistics

Threads
1,215,036
Messages
6,122,794
Members
449,095
Latest member
m_smith_solihull

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