PC Review


Reply
Thread Tools Rate Thread

Date Value in wrong format on userform

 
 
Corey
Guest
Posts: n/a
 
      7th Nov 2006
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....
 
Reply With Quote
 
 
 
 
Norman Jones
Guest
Posts: n/a
 
      7th Nov 2006
Hi Corey,

Try:

'=============>>
Private Sub UserForm_Initialize()
Me.TextBox1.Value = _
Format(Range("E2").Value, "dd/mm/yy")
End Sub
'<<=============


---
Regards,
Norman



"Corey" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
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....


 
Reply With Quote
 
Norman Jones
Guest
Posts: n/a
 
      7th Nov 2006
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


 
Reply With Quote
 
=?Utf-8?B?U3RlZmk=?=
Guest
Posts: n/a
 
      7th Nov 2006
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> 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....
>
>
>

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      7th Nov 2006
TextBox1.Text = Format(TextBox1.Text,"d mmmm yyyy")

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Corey" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
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....


 
Reply With Quote
 
Norman Jones
Guest
Posts: n/a
 
      7th Nov 2006
Hi Steffi,

> This format returns the month as October!


Indeed! As does my last post!


---
Regards,
Norman


 
Reply With Quote
 
Mike Woodhouse
Guest
Posts: n/a
 
      7th Nov 2006


On Nov 7, 10:32 am, "Corey" <coreyt...@exemail.com.au> 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

 
Reply With Quote
 
Norman Jones
Guest
Posts: n/a
 
      7th Nov 2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
>
> On Nov 7, 10:32 am, "Corey" <coreyt...@exemail.com.au> 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
>



 
Reply With Quote
 
Norman Jones
Guest
Posts: n/a
 
      7th Nov 2006
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


 
Reply With Quote
 
Corey
Guest
Posts: n/a
 
      7th Nov 2006
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi Corey,
>
> Try:
>
> '=============>>
> Private Sub UserForm_Initialize()
> Me.TextBox1.Value = _
> Format(Range("E2").Value, "dd/mm/yy")
> End Sub
> '<<=============
>
>
> ---
> Regards,
> Norman
>
>
>
> "Corey" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> 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....
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
from date format convert to text format is wrong nooris Microsoft Excel Misc 2 4th Feb 2010 03:41 PM
Get a date to display in date format on a UserForm ryguy7272 Microsoft Excel Programming 12 22nd Mar 2008 10:31 PM
Date Format in Userform Peter1999 Microsoft Excel Programming 3 8th Jun 2006 04:32 PM
Date format in userform cutsygurl Microsoft Excel Programming 3 19th Apr 2006 09:44 AM
Date format from UserForm SOS Microsoft Excel Programming 3 16th Feb 2006 02:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:48 AM.