Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like to format a cell to write out an amount of money in another
cell. Like on a Cheque. Example. $6.25 = Six and 25/100. The written portion would change automatically when the amount changes. Can someone tell me if formatting exists. Thank you. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There is no built in formatting to do this, however, it's not rocket science
to write it: Function TextMe(Real_Number As Variant) As String Dim myString As String 'Thousands If (Int(Real_Number / 1000) < 0) Then myString = Int(Real_Number / 1000) & " thousand" End If 'Get remainder Real_Number = Real_Number - (Int(Real_Number / 1000) * 1000) If (Int(Real_Number / 100) < 0) Then If myString < "" Then myString = myString & ", " End If myString = myString & Int(Real_Number / 100) & " hundred" End If 'Get remainder Real_Number = Real_Number - (Int(Real_Number / 100) * 100) etc. TextMe = myString End Function "DebbieSue" wrote: I would like to format a cell to write out an amount of money in another cell. Like on a Cheque. Example. $6.25 = Six and 25/100. The written portion would change automatically when the amount changes. Can someone tell me if formatting exists. Thank you. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In my case, I would need to be a rocket scientist. I used the function and I
typed in 385.25 and it gave me 3 hundred. That was it. Nothing else. I am very new to this, so sorry if I'm a pain. Thank you, Debbie "BobT" wrote: There is no built in formatting to do this, however, it's not rocket science to write it: Function TextMe(Real_Number As Variant) As String Dim myString As String 'Thousands If (Int(Real_Number / 1000) < 0) Then myString = Int(Real_Number / 1000) & " thousand" End If 'Get remainder Real_Number = Real_Number - (Int(Real_Number / 1000) * 1000) If (Int(Real_Number / 100) < 0) Then If myString < "" Then myString = myString & ", " End If myString = myString & Int(Real_Number / 100) & " hundred" End If 'Get remainder Real_Number = Real_Number - (Int(Real_Number / 100) * 100) etc. TextMe = myString End Function "DebbieSue" wrote: I would like to format a cell to write out an amount of money in another cell. Like on a Cheque. Example. $6.25 = Six and 25/100. The written portion would change automatically when the amount changes. Can someone tell me if formatting exists. Thank you. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have a look at Bob Phillips' site for several methods.
http://www.xldynamic.com/source/xld.xlFAQ0004.html If you're not familiar with VBA and macros, see David McRitchie's site for more on "getting started". http://www.mvps.org/dmcritchie/excel/getstarted.htm or Ron de De Bruin's site on where to store macros. http://www.rondebruin.nl/code.htm Gord Dibben MS Excel MVP On Fri, 17 Oct 2008 10:24:00 -0700, DebbieSue wrote: In my case, I would need to be a rocket scientist. I used the function and I typed in 385.25 and it gave me 3 hundred. That was it. Nothing else. I am very new to this, so sorry if I'm a pain. Thank you, Debbie "BobT" wrote: There is no built in formatting to do this, however, it's not rocket science to write it: Function TextMe(Real_Number As Variant) As String Dim myString As String 'Thousands If (Int(Real_Number / 1000) < 0) Then myString = Int(Real_Number / 1000) & " thousand" End If 'Get remainder Real_Number = Real_Number - (Int(Real_Number / 1000) * 1000) If (Int(Real_Number / 100) < 0) Then If myString < "" Then myString = myString & ", " End If myString = myString & Int(Real_Number / 100) & " hundred" End If 'Get remainder Real_Number = Real_Number - (Int(Real_Number / 100) * 100) etc. TextMe = myString End Function "DebbieSue" wrote: I would like to format a cell to write out an amount of money in another cell. Like on a Cheque. Example. $6.25 = Six and 25/100. The written portion would change automatically when the amount changes. Can someone tell me if formatting exists. Thank you. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Insert Row and keep merged cells formatting | Excel Discussion (Misc queries) | |||
Autofit Merged cell Code is changing the format of my merged cells | Excel Discussion (Misc queries) | |||
Conditional formatting with merged cells | Excel Programming | |||
Conditional Formatting Merged Cells | Excel Worksheet Functions | |||
how do i link merged cells to a merged cell in another worksheet. | Excel Worksheet Functions |