![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
I am having a problem writing a piece of code in excel to move a dollar figure ie. 458.23 to 45823. The bank wants to assume the decimal then format it. So it would look something like this 000000045823. It has to be in VB because I import all the info from a text file format it and convert it back to a txt file for the bank.
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Houston,Texas
Posts: 418
|
Why not just multiply by 100?
|
|
|
|
|
|
#3 |
|
Guest
Posts: n/a
|
I need a piece of code. I am using numberformat in VB to assume the "0" in front of the amount. I need something to either move the number to the left 2 spaces. Or a formula to use inside the cell to multiply by 100
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Location: Houston,Texas
Posts: 418
|
How is the text file you import laid out? One column or multi column? If Multi column, how is it delimited? You should be able to do the multiplcation when you import the file.
|
|
|
|
|
|
#5 |
|
Guest
Posts: n/a
|
The file is delimited with comas. Do you know code that would multiply when I import it?
|
|
|
|
#6 |
|
Guest
Posts: n/a
|
I have time to explain a little now. I have a checking statement that gets exported from a UNIX box. It exports account number, check number, amount, and date. They all have to have leading "0" which I did with formatnumber. I have everything working except the amount field when I export. When I format the amount I lose the decimal. So if the txt file from the UNIX system says 452.23 I import it, format it using formatnumber("000000000000"). I get 000000000452. I am missing something simple.
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|