Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA - Userform textbox formatting

Hi, i have created a form for an Excel SSheet, with various textboxs an
combo boxs. All work fine in that the data entered/selected ends up i
the cells required.

My problem is that it would like some formatting for the textboxs. Th
first box contains the date:

txtDate.Value = Date

The date appears on the form as d/m/yy, but i would like it to b
dd/mm/yy.

Also when this date is placed in a cell, it is in general format jus
as 1/3/04 and not as 38047, it isn't a true date.

Lastly how can i apply some conditional formatting for the other boxs
i.e

txtWeight

Number to 0 or 1 decimal places.

An error message/retry - cancel button if the number is <50 and 100.

Many Thank

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Excel VBA - Userform textbox formatting

"thesteelmaker " wrote in message
...

txtDate.Value = Date

The date appears on the form as d/m/yy, but i would like it to be
dd/mm/yy.


txtDate.Text = Format$(Date, "dd/mm/yy")

.. Also when this date is placed in a cell, it is in general format just
as 1/3/04 and not as 38047, it isn't a true date.


Sure it is. Just format the cell in date format and see for yourself. The system is
actually 38047 days since new year to 1900; which is 1/3/04.

--
HTH. Best wishes Harald
Followup to newsgroup only please


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
Excel VBA - Userform Checkbox/Textbox Problem Thunder5 Excel Programming 1 February 16th 04 02:06 PM
Formatting userform textbox - help required Kennyatwork Excel Programming 3 February 6th 04 04:58 PM
Formatting number in a UserForm TextBox John Pierce Excel Programming 3 January 26th 04 04:57 PM
formatting text in TextBox in UserForm Kevin Excel Programming 2 November 7th 03 01:34 PM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM


All times are GMT +1. The time now is 05:56 AM.

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

About Us

"It's about Microsoft Excel"