Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a textbox that displays the value of a cell(E2), but the worksheet displays:
31 October 2006, yet the userform textbox value shows 10/31/06. Is there a way i can change this to display as the sheet view (31 October 2006) ? Corey.... |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Corey,
Try: '============= Private Sub UserForm_Initialize() Me.TextBox1.Value = _ Format(Range("E2").Value, "dd/mm/yy") End Sub '<<============= --- Regards, Norman "Corey" wrote in message ... I have a textbox that displays the value of a cell(E2), but the worksheet displays: 31 October 2006, yet the userform textbox value shows 10/31/06. Is there a way i can change this to display as the sheet view (31 October 2006) ? Corey.... |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Corey,
Or, more consistent with your indicated format: '============= Private Sub UserForm_Initialize() Me.TextBox1.Value = _ Format(Range("E2").Value, "dd mmmm yyyy") End Sub '<<============= --- Regards, Norman |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Me.TextBox1.Value = _
Format(Range("E2").Value, "dd/mmmm/yy") This format returns the month as October! Regards, Stefi €˛Norman Jones€¯ ezt Ć*rta: Hi Corey, Try: '============= Private Sub UserForm_Initialize() Me.TextBox1.Value = _ Format(Range("E2").Value, "dd/mm/yy") End Sub '<<============= --- Regards, Norman "Corey" wrote in message ... I have a textbox that displays the value of a cell(E2), but the worksheet displays: 31 October 2006, yet the userform textbox value shows 10/31/06. Is there a way i can change this to display as the sheet view (31 October 2006) ? Corey.... |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Steffi,
This format returns the month as October! Indeed! As does my last post! --- Regards, Norman |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks for the reply Norman
I now can get 31/10/06 instead of 10/31/06, But my aim is for "31 October 2006" I tried changing the .value to .text but no go. Any idea's ctm "Norman Jones" wrote in message ... Hi Corey, Try: '============= Private Sub UserForm_Initialize() Me.TextBox1.Value = _ Format(Range("E2").Value, "dd/mm/yy") End Sub '<<============= --- Regards, Norman "Corey" wrote in message ... I have a textbox that displays the value of a cell(E2), but the worksheet displays: 31 October 2006, yet the userform textbox value shows 10/31/06. Is there a way i can change this to display as the sheet view (31 October 2006) ? Corey.... |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ina ctual fact i am now geting what i originally had.
I read you other post and tried: Private Sub UserForm_Initialize() Me.TextBox1.Value = _ Format(Range("E2").Value, "dd/mm/yy") End Sub And placed this in the userform code Is that where is belongs? I do not get any change in the textbox apperanace ???? Is there somehting i need to change in the textbox properties also ?? I have it linked to cell E2. |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Corey,
Ina ctual fact i am now geting what i originally had. I read you other post and tried: Private Sub UserForm_Initialize() Me.TextBox1.Value = _ Format(Range("E2").Value, "dd/mm/yy") End Sub And placed this in the userform code Is that where is belongs? Yes. I do not get any change in the textbox apperanace ???? Is there somehting i need to change in the textbox properties also ?? I have it linked to cell E2. Delete the ControlSource property value and retry the suggested code .. --- Regards, Norman |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That was it.
The E2 that was in the controlsource. Perfect. Thanks for the help, did you notice my other clipboard post problem ? ctm "Norman Jones" wrote in message ... Hi Corey, Ina ctual fact i am now geting what i originally had. I read you other post and tried: Private Sub UserForm_Initialize() Me.TextBox1.Value = _ Format(Range("E2").Value, "dd/mm/yy") End Sub And placed this in the userform code Is that where is belongs? Yes. I do not get any change in the textbox apperanace ???? Is there somehting i need to change in the textbox properties also ?? I have it linked to cell E2. Delete the ControlSource property value and retry the suggested code . --- Regards, Norman |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Corey,
I now can get 31/10/06 instead of 10/31/06, But my aim is for "31 October 2006" I tried changing the .value to .text but no go. Any idea's Either: Me.TextBox1.Value = _ Format(Range("E2").Value, "dd mmmm yyyy") or Me.TextBox1.Text = Range("E2").Text worked for me. The first stipulates the format of the TextBox, the second returns the text as seen in the worksheet --- Regards, Norman |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I seem to still get, in the textbox properties under the text tab
the10/31/2006 even though i did not put it there. I think this may be causing the absence of 31 October 2006. I can type that in the text tab but i then get no text displayed on the userform at all. tried the Me.TextBox1.Text = Range("E2").Text but i still get the same 10/31/2006??? "Norman Jones" wrote in message ... Hi Corey, I now can get 31/10/06 instead of 10/31/06, But my aim is for "31 October 2006" I tried changing the .value to .text but no go. Any idea's Either: Me.TextBox1.Value = _ Format(Range("E2").Value, "dd mmmm yyyy") or Me.TextBox1.Text = Range("E2").Text worked for me. The first stipulates the format of the TextBox, the second returns the text as seen in the worksheet --- Regards, Norman |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Corey,
See me preceding response - remove the ControlSource assignment. --- Regards, Norman "Corey" wrote in message ... I seem to still get, in the textbox properties under the text tab the10/31/2006 even though i did not put it there. I think this may be causing the absence of 31 October 2006. I can type that in the text tab but i then get no text displayed on the userform at all. tried the Me.TextBox1.Text = Range("E2").Text but i still get the same 10/31/2006??? |
#13
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
TextBox1.Text = Format(TextBox1.Text,"d mmmm yyyy")
-- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Corey" wrote in message ... I have a textbox that displays the value of a cell(E2), but the worksheet displays: 31 October 2006, yet the userform textbox value shows 10/31/06. Is there a way i can change this to display as the sheet view (31 October 2006) ? Corey.... |
#14
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() On Nov 7, 10:32 am, "Corey" wrote: I have a textbox that displays the value of a cell(E2), but the worksheet displays: 31 October 2006, yet the userform textbox value shows 10/31/06. Is there a way i can change this to display as the sheet view (31 October 2006) ? If your userform knows the address of the cell, or has a range that points to it, then the .Text property should display the date as it is seen in the worksheet... Mike |
#15
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Mike,
If your userform knows the address of the cell, or has a range that points to it, then the .Text property should display the date as it is seen in the worksheet... I think that you will find that, without an intervening format instruction, the textbox will speak with VBA's intrinsic American accent! --- Regards, Norman "Mike Woodhouse" wrote in message oups.com... On Nov 7, 10:32 am, "Corey" wrote: I have a textbox that displays the value of a cell(E2), but the worksheet displays: 31 October 2006, yet the userform textbox value shows 10/31/06. Is there a way i can change this to display as the sheet view (31 October 2006) ? If your userform knows the address of the cell, or has a range that points to it, then the .Text property should display the date as it is seen in the worksheet... Mike |
#16
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Mike,
I withdraw my comment with apologies! Me.TextBox1.Text = Range("E2").Text will display the worksheet's visual representation of the date, --- Regards, Norman |
#17
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
A word of caution with the .Text property. If the column is not wide enough to display the date and instead displayed ####### that is what will be returned in the textbox. Cheers Andy Mike Woodhouse wrote: On Nov 7, 10:32 am, "Corey" wrote: I have a textbox that displays the value of a cell(E2), but the worksheet displays: 31 October 2006, yet the userform textbox value shows 10/31/06. Is there a way i can change this to display as the sheet view (31 October 2006) ? If your userform knows the address of the cell, or has a range that points to it, then the .Text property should display the date as it is seen in the worksheet... Mike -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
from date format convert to text format is wrong | Excel Discussion (Misc queries) | |||
date in wrong format | New Users to Excel | |||
Date in wrong format | Excel Discussion (Misc queries) | |||
Wrong date format in header | Excel Discussion (Misc queries) | |||
Macro gives the wrong date format | Excel Programming |