Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date Format
Hi,
I have a combobox displaying a range of available dates in the format dd/mm/yy. Once selected the date should display in the combobox. Unfortunately once selected the date displays in numeric. Is there a method to have the combobox maintain the date format? Your help is really appreciated. Mickey |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date Format
Private Sub ComboBox1_Change()
ComboBox1.Value = Format(ComboBox1.Value, "DD/MM/YY") End Sub "MBlake" wrote: Hi, I have a combobox displaying a range of available dates in the format dd/mm/yy. Once selected the date should display in the combobox. Unfortunately once selected the date displays in numeric. Is there a method to have the combobox maintain the date format? Your help is really appreciated. Mickey |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date Format
Hi Toppers,
Brilliant!, I've been looking at that for a few days and got nowhere. I am very grateful for your help. Is it now possible to transfer the date dd/mm/yy to four text boxes day/datemonth/year so that when a user enter the date, the textboxes change to - for example - Mon/15/Apr/05. Again I can do this in the worksheet but how do I accomplish it on a user form? Mickey |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date Format
Hi,
Private Sub ComboBox1_Change() Weekdays = Array("Sun","Mon", "Tue", "Wed", "Thu", "Fri", "Sat) ComboBox1.Value = Format(ComboBox1.Value, "DD/MMM/YY") myweekday = Weekdays(Weekday(ComboBox1.Value) - 1) TextBox1.value = myweekday & "/" & ComboBox1.Value TextBox2.value = myweekday & "/" & ComboBox1.Value ..... End Sub HTH "MBlake" wrote: Hi Toppers, Brilliant!, I've been looking at that for a few days and got nowhere. I am very grateful for your help. Is it now possible to transfer the date dd/mm/yy to four text boxes day/datemonth/year so that when a user enter the date, the textboxes change to - for example - Mon/15/Apr/05. Again I can do this in the worksheet but how do I accomplish it on a user form? Mickey |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date Format
Cheers Toppers,
I'm getting a 'variable not defined' error and the line 'Weekdays=Array etc is highlighted. I'll take a look and see if I can figure it out. Cheers for your help, very much appreciated, Mickey "Toppers" wrote in message ... Hi, Private Sub ComboBox1_Change() Weekdays = Array("Sun","Mon", "Tue", "Wed", "Thu", "Fri", "Sat) ComboBox1.Value = Format(ComboBox1.Value, "DD/MMM/YY") myweekday = Weekdays(Weekday(ComboBox1.Value) - 1) TextBox1.value = myweekday & "/" & ComboBox1.Value TextBox2.value = myweekday & "/" & ComboBox1.Value .... End Sub HTH "MBlake" wrote: Hi Toppers, Brilliant!, I've been looking at that for a few days and got nowhere. I am very grateful for your help. Is it now possible to transfer the date dd/mm/yy to four text boxes day/datemonth/year so that when a user enter the date, the textboxes change to - for example - Mon/15/Apr/05. Again I can do this in the worksheet but how do I accomplish it on a user form? Mickey |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date Format
You need to declare the variables before you use them. E.g.,
Dim Weekdays As Variant Dim MyWeekday As Variant -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "MBlake" wrote in message ... Cheers Toppers, I'm getting a 'variable not defined' error and the line 'Weekdays=Array etc is highlighted. I'll take a look and see if I can figure it out. Cheers for your help, very much appreciated, Mickey "Toppers" wrote in message ... Hi, Private Sub ComboBox1_Change() Weekdays = Array("Sun","Mon", "Tue", "Wed", "Thu", "Fri", "Sat) ComboBox1.Value = Format(ComboBox1.Value, "DD/MMM/YY") myweekday = Weekdays(Weekday(ComboBox1.Value) - 1) TextBox1.value = myweekday & "/" & ComboBox1.Value TextBox2.value = myweekday & "/" & ComboBox1.Value .... End Sub HTH "MBlake" wrote: Hi Toppers, Brilliant!, I've been looking at that for a few days and got nowhere. I am very grateful for your help. Is it now possible to transfer the date dd/mm/yy to four text boxes day/datemonth/year so that when a user enter the date, the textboxes change to - for example - Mon/15/Apr/05. Again I can do this in the worksheet but how do I accomplish it on a user form? Mickey |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date Format
Sorry about the variable declarations - I hadn't set Option Explicit when I
tested it. Hope it is OK now .. and thank you Chip. "MBlake" wrote: Cheers Toppers, I'm getting a 'variable not defined' error and the line 'Weekdays=Array etc is highlighted. I'll take a look and see if I can figure it out. Cheers for your help, very much appreciated, Mickey "Toppers" wrote in message ... Hi, Private Sub ComboBox1_Change() Weekdays = Array("Sun","Mon", "Tue", "Wed", "Thu", "Fri", "Sat) ComboBox1.Value = Format(ComboBox1.Value, "DD/MMM/YY") myweekday = Weekdays(Weekday(ComboBox1.Value) - 1) TextBox1.value = myweekday & "/" & ComboBox1.Value TextBox2.value = myweekday & "/" & ComboBox1.Value .... End Sub HTH "MBlake" wrote: Hi Toppers, Brilliant!, I've been looking at that for a few days and got nowhere. I am very grateful for your help. Is it now possible to transfer the date dd/mm/yy to four text boxes day/datemonth/year so that when a user enter the date, the textboxes change to - for example - Mon/15/Apr/05. Again I can do this in the worksheet but how do I accomplish it on a user form? Mickey |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date Format
Cheers Toppers,
It all works very well, Mickey |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
permanent conversion of 1904 date format to 1900 date format | Excel Worksheet Functions | |||
How do I convert dd/mm/yy date format to yyddd Julian date format | Excel Worksheet Functions | |||
change date format dd/mm/yyyy to Julian date format? | Excel Worksheet Functions | |||
code to convert date from TEXT format (03-02) to DATE format (200203) | Excel Programming | |||
Change a date in text format xx.xx.20xx to a recognised date format | Excel Programming |