Let’s take an example to understand how and where we can format the cell for accounting.
We have product’s amount data in range A1:B9 in which column A contains Product name and column B contains amount of it. We want to format the amount range as accounting. The format puts dollar sign in the left and add two decimals to the number. This format is meant to display money.
To write the macro, follow below given steps:-
Cara Mudah Membuat Form Input Kode Akun dengan Excel Macro 15 Juni 2018 3 Januari 2017 Oleh Wadiyo Kode Akun Akuntansi bisa di-input dengan form yang dibuat dengan menggunakan Excel Macro. Pokok bahasan yang disajikan dalam buku ini meliputi: - Pengenalan Akuntansi - Mengenal Program Microsoft Excel - Mengenal Macro Excel - Membuat Aplikasi Akuntansi - Contoh Aplikasi Akuntansi Perusahaan Jasa - Contoh Aplikasi Perusahaan Dagang ===== [+] Welcome Reseller [+] Langsung di order aja ya gan:) [+] Semua Ready Stock [+] Kunjungi toko.
- Open VBA Page press the key Alt+F11.
- Insert a module.
- Write the below mentioned code:
Sub FormatAccounting()
Dim Sh As Worksheet
Set Sh = ThisWorkbook.Sheets(1)
Sh.Range(“B2:B9″).NumberFormat = “_($*#,##0.00_);_($*(#,##0.00);_($*””_””??_);_(@_)”
End Sub
![Akuntansi Akuntansi](/uploads/1/2/5/8/125848309/544879524.jpg)
Code Explanation:-
First we have given the subject for the code, then we had defined all the variables after that we had defined the range where we want to put the accounting format.
![Membuat Vba Akuntansi Membuat Vba Akuntansi](http://asosiasiguruekonomi.files.wordpress.com/2011/12/worksheet.jpg)
When you will run the Macro by pressing the key F5, you will get the desired result in Microsoft Excel.
@ www.excelforum one of the user has asked about the similar question:-
$ Sign in front of value
I have this code but can’t seem to figure out how I can put a dollar sign in front. Code below does not put a $ sign in front of this value 2220.45-. Would like it to display as $2220.45-
To check the solution, please click here.