Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Format monetary amount to 9 digits with No decimals without rounding

I need to convert a standard dollar amount (eg 157.62) to a 9-digit
number without decimals or rounding (eg 000015762). The formulas I've
tried so far a

For Each rw In ActiveSheet.UsedRange.Rows
If Application.CountIf(rw, "*monetary*") 0 Then
With rw
.NumberFormat = "0000000.00;(0000000.00)"
End With
End If
Next

Which formats as "0000157.62". And:

For Each rw In ActiveSheet.UsedRange.Rows
If Application.CountIf(rw, "*monetary*") 0 Then
With rw
.NumberFormat = "000000000;(000000000)"
End With
End If
Next

Which formats as "000000158".

Does such a thing exist? Any assistance would be greatly appreciated.
Thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Billigmeier
 
Posts: n/a
Default Format monetary amount to 9 digits with No decimals without roundi

=TEXT(A1*100,"000000000")


--
Regards,
Dave


" wrote:

I need to convert a standard dollar amount (eg 157.62) to a 9-digit
number without decimals or rounding (eg 000015762). The formulas I've
tried so far a

For Each rw In ActiveSheet.UsedRange.Rows
If Application.CountIf(rw, "*monetary*") 0 Then
With rw
.NumberFormat = "0000000.00;(0000000.00)"
End With
End If
Next

Which formats as "0000157.62". And:

For Each rw In ActiveSheet.UsedRange.Rows
If Application.CountIf(rw, "*monetary*") 0 Then
With rw
.NumberFormat = "000000000;(000000000)"
End With
End If
Next

Which formats as "000000158".

Does such a thing exist? Any assistance would be greatly appreciated.
Thanks in advance.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Format monetary amount to 9 digits with No decimals without roundi

Thanks for the quick response. When I tested your suggestion, I
received a "Compile Error: Sub or Function not defined". This is the
code as I have it:

For Each rw In ActiveSheet.UsedRange.Rows
If Application.CountIf(rw, "*monetary*") 0 Then
With rw
.NumberFormat = Text(A1 * 100, "000000000")
End With
End If
Next

I'm definitely a novice, so I'm not sure where to begin
troubleshooting. Thanks again for your help.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Billigmeier
 
Posts: n/a
Default Format monetary amount to 9 digits with No decimals without ro

Heh, no that is an excel built in function, just place that formula in any
cell within the spreadsheet (not in a macro), and change the reference of A1
to the cell you wish to change. Sorry for not specifying :-)

--
Regards,
Dave


" wrote:

Thanks for the quick response. When I tested your suggestion, I
received a "Compile Error: Sub or Function not defined". This is the
code as I have it:

For Each rw In ActiveSheet.UsedRange.Rows
If Application.CountIf(rw, "*monetary*") 0 Then
With rw
.NumberFormat = Text(A1 * 100, "000000000")
End With
End If
Next

I'm definitely a novice, so I'm not sure where to begin
troubleshooting. Thanks again for your help.


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Format monetary amount to 9 digits with No decimals without ro

I guess that shows how much of a novice I truly am. The problem is
that this macro is used on a spreadsheet which imports data from a CSV
file on a weekly basis. I also need to have this formula applied
conditionally to cells with the "monetary" data only. Because of this,
the only viable option I've found is to do it through a macro. Is
there a way to apply the formula you've given to variable row based on
the date of a specific cell?

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
format row of cells to highlight least amount oceantravel Excel Worksheet Functions 1 October 3rd 05 09:55 PM
month & year format in two digits Morphyus C via OfficeKB.com Excel Discussion (Misc queries) 1 August 5th 05 06:22 PM
How can I format the #of decimals, field types, etc. automaticall. JOET Excel Discussion (Misc queries) 1 April 2nd 05 12:14 AM
How do I format cells to a specific number of digits? Gabriele Excel Discussion (Misc queries) 3 February 5th 05 03:17 PM
Conditional Format With SUMIF Minitman Excel Worksheet Functions 3 November 1st 04 02:58 PM


All times are GMT +1. The time now is 03:07 PM.

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"