LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default pLeAsE hELp! format function in excel visual basic editor

Joel,

It worked!! Thank you very much.

J.Brice

"Joel" wrote:

It looks like your have to go from text to numberic back to text. I'm going
to use an intemediate variable, but it is not necessary

Private Sub CommandButton1_Click()
numbervalue = val(TextBox1.Text) / 43560# 'convert to number
TextBox4.Text = format(numbervalue,"###,###,###.##")
End Sub


"Alpineman2" wrote:

Hi Joel,

Thank you, but I don't quite understand one thing. Where I place "mystring
= format" code?
Below is an example of what I am trying to accomplish:
Private Sub CommandButton1_Click()
TextBox4.Text = (TextBox1.Text / 43560)
End Sub

I do very much appreciate your help.
Thank you,

J.Brice

"Joel" wrote:

You need to convert the number to a string using the format function. the
format parameter is the same as the worksheet formats that you can look at in
the menu
Format - Cells - Number. for example

mystring = format(mynumber,"general")
mystring = format(mynumber,"#0")
mystring = format(mydate,"mm-yyyyl")
mystring = format(mynumber,"###,###,###.##l")


"Alpineman2" wrote:

How do I format a textbox ([Input Textbox] & [Sum (locked) Textbox]) within a
Userform in the following formats:
Numeric - such as ###,###,###.## (using 1000 separator [,])
Currency
Accounting
Percentage
Date

Note: I am a newbie, if someone would explain the function and where I would
implement such. I would greatly appreciate any guidance.




 
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
please help : Excel visual basic editor AMIT Excel Programming 2 March 16th 07 08:01 PM
Visual basic Code or editor won't load in Excel johnsday Excel Programming 2 February 2nd 06 06:00 PM
Can I run Visual Basic procedure using Excel Visual Basic editor? john.jacobs71[_2_] Excel Programming 3 December 26th 05 02:22 PM
How to disable Visual Basic Editor in Excel file No Name Excel Programming 2 April 24th 04 01:52 PM
Visual Basic editor terminates Excel 2003 Jim Zeeb Excel Programming 3 January 30th 04 08:22 PM


All times are GMT +1. The time now is 11:49 AM.

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"