Formatting currency with the cents but without the decimal point

M

mrbobader

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

Note: vAmt is
Dim vAmt As String
 
B

Bob Phillips

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
 
R

Ron Rosenfeld

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")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top