Excel

Make Date Column Independent of System Date Format

Ease of Use

Hard

Version tested with

2003 

Submitted by:

gaursh

Description:

I made Column A of Sheet1 as Date Acceptable in MM/DD/YYYY Format.. It works well when my system date format MM/DD/YYYY format, when i change System Date Format to any other date format. it Changes date to system date format. After Entering date, Date value must remain In MM/DD/YYYY format only. 

Discussion:

In my Project I want Date must be accept in MM/DD/YYYY Format independent of whatever is the date format. Date in Column A of Sheet1 Must Accept Date in MM/DD/YYYY Format and Display also in MM/DD/YYYY format. Code Work when we enter date in Column A of Sheet1 , When System Date Format is MM/DD/YYYY , My code works Fine , and I got desired Result. But When Syatem Date format is any other format than MM/DD/YYYY my code dont work .. It accepet Date in MM/DD/YYYY format But changes date to the system Date Format.. I want Date in MM/DD/YYYY acceptable in cell of Column A. and after enter date value it remain in MM/DD/YYYY format only.. 

Code:

instructions for use

			

How to use:

  1. after open the workbook , enable macros
 

Test the code:

  1. First change System Date Format from Regional and Language Options to MM/DD/YYYY,
  2. Then enter date in MM/DD/YYYY to Column A of Sheet 1 which will be acceptable in the cell of Column A.. For any other format of Date there are alerts restrict you to fill date in MM/DD/YYYY format. After Entering date Date value remain in MM/DD/YYYY.
  3. Now Change system date format to any other format like dd-mm-yyyy or yyyy-mm-dd.
  4. Then enter date in MM/DD/YYYY to Column A of Sheet 1 which will be acceptable in the cell of Column A.. For any other format of Date there are alerts restrict you to fill date in MM/DD/YYYY format. After Entering date, Date value changes to system date format which is not acceptable. Date must Remain in MM/DD/YYYY format only
 

Sample File:

date validate3.zip 13.2KB 

Approved by Jacob Hilderbrand


This entry has been viewed 206 times.

Please read our Legal Information and Privacy Policy
Copyright @2004 - 2020 VBA Express