Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Userform Textbox Format to fraction

Is there a way to make it so a userform textbox will only display
fractions ?

For Example:

If TextBox1 = A1 when the userform is activated and A1 has a value of
1.5 I want the textbox to show 1 1/2 . Any help on this would be
greatly appreciated.

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Userform Textbox Format to fraction

If the cell is formatted nicely:

Option Explicit
Private Sub UserForm_initialize()
me.textbox1.value = worksheets("sheet1").range("A1").Text
End Sub

if not, you can do the formatting yourself.

Option Explicit
Private Sub UserForm_initialize()
Me.TextBox1.Value _
= Application.Text(Worksheets("sheet1").Range("A1"). Value, "# #/##")
End Sub

wrote:

Is there a way to make it so a userform textbox will only display
fractions ?

For Example:

If TextBox1 = A1 when the userform is activated and A1 has a value of
1.5 I want the textbox to show 1 1/2 . Any help on this would be
greatly appreciated.

Thanks


--

Dave Peterson
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
Date Format for Userform TextBox John Calder New Users to Excel 4 July 29th 09 10:19 PM
Date Format in UserForm textbox. [email protected] Excel Programming 0 July 6th 07 03:52 PM
Number format of textbox in userform Bikash Excel Programming 3 June 27th 07 07:40 PM
format textbox in userform jeffP Excel Programming 1 January 25th 05 01:10 AM
Format of a TextBox in a userform MD Excel Programming 4 January 13th 05 05:42 PM


All times are GMT +1. The time now is 03:59 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"