Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Formatting currency with the cents but without the decimal point

I'm using VB through MS Excel and I needs to export check information in a text
format. The
bank is requiring that all fields take x number of characters, which I have
been
able to do except that the check amount needs to read 11 digits without
the decimal place. ie: $247.84 becomes 0000024784. I can get it to
00000247.84 with the vAmt = Format(Sheet1.Cells(i, 4),
"00000000.00")
but the minute I
take out the decimal, I get a decimal, I get 0000000247.

Note: vAmt is:
Dim vAmt As String
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default Formatting currency with the cents but without the decimal point

Try

vAmt = Replace(Format(Sheet1.Cells(i, 4),"00000000.00"),".","")


HTH

Bob

"mrbobader" wrote in message ...

I'm using VB through MS Excel and I needs to export check information in a
text
format. The
bank is requiring that all fields take x number of characters, which I have
been
able to do except that the check amount needs to read 11 digits without
the decimal place. ie: $247.84 becomes 0000024784. I can get it to
00000247.84 with the vAmt = Format(Sheet1.Cells(i, 4),
"00000000.00")
but the minute I
take out the decimal, I get a decimal, I get 0000000247.

Note: vAmt is:
Dim vAmt As String

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,045
Default Formatting currency with the cents but without the decimal point

On Mon, 25 Oct 2010 05:56:54 -0500, mrbobader
wrote:

I'm using VB through MS Excel and I needs to export check information in a text
format. The
bank is requiring that all fields take x number of characters, which I have
been
able to do except that the check amount needs to read 11 digits without
the decimal place. ie: $247.84 becomes 0000024784. I can get it to
00000247.84 with the vAmt = Format(Sheet1.Cells(i, 4),
"00000000.00")
but the minute I
take out the decimal, I get a decimal, I get 0000000247.

Note: vAmt is:
Dim vAmt As String



vAmt = Format(Sheet1.Cells(i, 4) * 100, "00000000000")

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
Auto Formatting Decimal Point Ben Dummar Excel Discussion (Misc queries) 5 September 18th 07 04:34 PM
Currency Rounding to nearest 5 cents Daniel Sloan Excel Discussion (Misc queries) 3 July 20th 06 08:42 AM
How do I format to currency when number includes cents? INEEDHELP Excel Worksheet Functions 2 April 13th 06 04:27 PM
defined cell as currency but still have to enter decimal point Beebs Excel Worksheet Functions 2 March 7th 06 11:56 PM
Currency Formatting to 3 decimal Places David Dalebroux Excel Programming 1 August 7th 04 09:22 PM


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