Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
pLeAsE hELp! format function in excel visual basic editor
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
pLeAsE hELp! format function in excel visual basic editor
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
pLeAsE hELp! format function in excel visual basic editor
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. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
pLeAsE hELp! format function in excel visual basic editor
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. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
please help : Excel visual basic editor | Excel Programming | |||
Visual basic Code or editor won't load in Excel | Excel Programming | |||
Can I run Visual Basic procedure using Excel Visual Basic editor? | Excel Programming | |||
How to disable Visual Basic Editor in Excel file | Excel Programming | |||
Visual Basic editor terminates Excel 2003 | Excel Programming |