Thursday, June 14, 2012

Change Date Format with Combo Box Control

Hi friends, I am giving you a new example on Changing Date Format.
Here is the Screen Shot


Here is the code...


Private Sub ComboBox1_Change()
  Range("K8").NumberFormat = ComboBox1.Text
End Sub


Private Sub Worksheet_Activate()
  ComboBox1.Clear
  ComboBox1.Text = "dd/mm/yy"
  ComboBox1.AddItem "dd/mm/yy"
  ComboBox1.AddItem "dd-mm-yyyy"
  ComboBox1.AddItem "dd-mm-yy"
  ComboBox1.AddItem "dddd, d mmmm, yyyy"
  ComboBox1.AddItem "mmmm dd, yyyy"
End Sub




I hope you would like this small and useful code.
Thanks

No comments:

Post a Comment