#1   Report Post  
Posted to microsoft.public.excel.misc
grahammal
 
Posts: n/a
Default TextBox Format


I have a TextBox on a UserForm that shows what is in cell "A1" on my
spreadsheet.
The contents of "A1" is always a date and is formatted to show the date
as dd-mmm-yyyy.
Assuming the date in cell "A1" is 28-Mar-2006, and by highlighting the
cell it also shows the same format at the top of the spreadsheet, why
does the TextBox show the date as 3/28/2006??
I want it to look like "A1" or at the very least 28/3/2006.


--
grahammal
------------------------------------------------------------------------
grahammal's Profile: http://www.excelforum.com/member.php...o&userid=20336
View this thread: http://www.excelforum.com/showthread...hreadid=527111

  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Umlas, Excel MVP
 
Posts: n/a
Default TextBox Format

in the userform initialize event:
Me.Textbox1.text=format(range("A1").Value,"dd-mmm-yyyy")

or

Me.textbox1.text = range("A1").Text

"grahammal" wrote:


I have a TextBox on a UserForm that shows what is in cell "A1" on my
spreadsheet.
The contents of "A1" is always a date and is formatted to show the date
as dd-mmm-yyyy.
Assuming the date in cell "A1" is 28-Mar-2006, and by highlighting the
cell it also shows the same format at the top of the spreadsheet, why
does the TextBox show the date as 3/28/2006??
I want it to look like "A1" or at the very least 28/3/2006.


--
grahammal
------------------------------------------------------------------------
grahammal's Profile: http://www.excelforum.com/member.php...o&userid=20336
View this thread: http://www.excelforum.com/showthread...hreadid=527111


  #3   Report Post  
Posted to microsoft.public.excel.misc
grahammal
 
Posts: n/a
Default TextBox Format


Where exactly do I enter what you have suggested. Am using Excel97

By the way, What does Me.xxxxxxx actually mean as I have tried to enter
suggested commands before and it always errors because of the 'Me' part
of the
program.


--
grahammal
------------------------------------------------------------------------
grahammal's Profile: http://www.excelforum.com/member.php...o&userid=20336
View this thread: http://www.excelforum.com/showthread...hreadid=527111

  #4   Report Post  
Posted to microsoft.public.excel.misc
Jim May
 
Posts: n/a
Default TextBox Format

In the VBE environment "select" your Userform in the Project Explorer
window, then at the menu click on View, then Code..
In code window that comes up (Userform should appear in the Left top
dropdown Object box)

Type out in the code window:

Private Sub UserForm_Initialize()

Me.Textbox1.text=format(range("A1").Value,"dd-mmm-yyyy")
End Sub

The Keyword "Me" means (a substitute for) "the objectname that this code
resides in"
HTH,
Jim May


"grahammal" wrote
in message ...

Where exactly do I enter what you have suggested. Am using Excel97

By the way, What does Me.xxxxxxx actually mean as I have tried to enter
suggested commands before and it always errors because of the 'Me' part
of the
program.


--
grahammal
------------------------------------------------------------------------
grahammal's Profile:
http://www.excelforum.com/member.php...o&userid=20336
View this thread: http://www.excelforum.com/showthread...hreadid=527111



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
can't format cell - have tried unlocking and unprotecting griffin Excel Discussion (Misc queries) 1 April 5th 05 02:11 AM
why does currency format change to number format? Cassie Excel Discussion (Misc queries) 3 March 18th 05 06:57 PM
Keep custom format in new worksheet Buddy Excel Discussion (Misc queries) 2 March 14th 05 10:03 AM
Copying a conditional format Meaux Excel Worksheet Functions 2 November 29th 04 10:19 AM
When I select "format cells", the format dialog box does not disp. Andy S. Excel Worksheet Functions 2 November 23rd 04 03:49 AM


All times are GMT +1. The time now is 11:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"