0

It is require to change the date column in excel as system date format.

if the system date format will be mm/dd/yyyy

In excel sheet i need to change it as mm/dd/yyyy
How to change it through VBA Excel?

Thanks in advance.

JMax
  • 26,109
  • 12
  • 69
  • 88
user1049518
  • 291
  • 7
  • 13
  • 25

1 Answers1

0

You can change the date format of cell to the regional (Windows) settings this way:

  1. Select the cells you want to change
  2. Right-click > Format Cells...
  3. Tab "Number", choose "Date"
  4. Choose a date begining with an asterisk *: *05/13/2011

More information on this SO thread: What is the best way to say format is mm/dd/yyyy - but in the local format?

[EDIT] With VBA you can do

Sub test()
    Selection.NumberFormat = "m/d/yyyy"
End Sub

m/d/yyyy represents the regional settings as described above

Community
  • 1
  • 1
JMax
  • 26,109
  • 12
  • 69
  • 88
  • Thanks for you reply. But, When the date is less than 12 it is not working, it remains the same like 10/09/2011. – user1049518 Dec 28 '11 at 11:14