atau...
Dim Tbl As Range, n As Long
Set Tbl = Sheet1.Range("b4").CurrentRegion
With ListBox1
.ColumnCount = 3
.ColumnWidths = "60; 80; 80"
.ListStyle = 1
.Clear
For n = 2 To Tbl.Rows.Count
.AddItem Tbl(n, 1)
.List(.ListCount - 1, 1) = FormatNumber(Tbl(n, 2), 2)
.List(.ListCount - 1, 2) = FormatNumber(Tbl(n, 2), 0)
Next
End With
Set Tbl = Sheet1.Range(
With ListBox1
.ColumnCount = 3
.ColumnWidths = "60; 80; 80"
.ListStyle = 1
.Clear
For n = 2 To Tbl.Rows.Count
.AddItem Tbl(n, 1)
.List(.ListCount - 1, 1) = FormatNumber(
.List(.ListCount - 1, 2) = FormatNumber(
Next
End With
----- Original Message -----From: siti ViSent: Thursday, March 18, 2010 12:09 PMSubject: Re: ]] XL-mania [[ Tampilkan format currency dalam "ListBox" ?yang dimaksud dlm pertanyaan itu TAMPILNYA DI LISTBOX, cukan di cells.saya ogah menggunakan contoh yg diajukan karena hanya berupa gambar/ tidak disertakan sheet berisi data yg terlibat dlm makro tsbmendingan "mbikin" sendiri deh.... kerjabakti sebentar ndak pa pa lah...Private Sub UserForm_Initialize()
Dim Tbl As Range, n As Long
Set Tbl = Sheet1.Range("b4").CurrentReg ion
ListBox1.Clear
For n = 1 To Tbl.Rows.Count
With ListBox1
.AddItem Tbl(n, 1)
.List(.ListCount - 1, 1) = Format(Tbl(n, 2), "#,##0.00")
.List(.ListCount - 1, 2) = Format(Tbl(n, 2), "_($* #,##0.00_)")
End With
Next
End Subpada kolom kedua walaupun tanda pemisah riuan dan pemisah desimal telah tampiltetapi format rata kanan belum adapada kolom ketiga walaupun telah diformat "accountng" hasilnya tidak sesuai keinginan(tidak bisa rata kanan) karena LISTBOX ( /combobox, /textbox) bukanlah cell.kita tunggu, mungkin ada members lain tahu cara merata-kanankan data di kolom listbox
__._,_.___
+-:: XL-mania ::::::::::::::::::::----------------------------------+
| momods pecas ndaheeee... :( :( :( |
| http://www.facebook.com/group.php?gid=37671048001&ref=mf |
+-------------------------------------------------------------------+
| DILARANG : MLM, money game, OOT, iklan tanpa izin, SARA, testing, |
| pembicaraan pribadi, one line message, melecehkan, tidak sopan. |
+-------------------------------------------------------------------+
| Buat subjek yang kreatif, jangan : "tanya", "help", "mohon bantu" |
| Usahakan besar attachment < 200 kb. Gunakan winzip jika perlu. |
+-------------------------------------------------------------------+
| Ajak teman-teman Anda bergabung dengan mengirim e-mail kosong ke |
| XL-mania-subscribe@yahoogroups.com atau kirimkan mereka file dari |
| http://groups.yahoo.com/group/XL-mania/files/Promotion/ |
+-------------------------------------------------------------------+
| Berikan testimoni di : http://www.friendster.com/xlmania atau... |
| http://www.xl-mania.com/2008/06/testimoni-xl-mania.html |
+-------------------------------------------------------------------+
| Message lama ada di : |
| http://groups.yahoo.com/group/XL-mania/messages [perlu yahoo id] |
| http://www.mail-archive.com/xl-mania@yahoogroups.com |
+-------------------------------------------------------------------+
| momods pecas ndaheeee... :( :( :( |
| http://www.facebook.com/group.php?gid=37671048001&ref=mf |
+-------------------------------------------------------------------+
| DILARANG : MLM, money game, OOT, iklan tanpa izin, SARA, testing, |
| pembicaraan pribadi, one line message, melecehkan, tidak sopan. |
+-------------------------------------------------------------------+
| Buat subjek yang kreatif, jangan : "tanya", "help", "mohon bantu" |
| Usahakan besar attachment < 200 kb. Gunakan winzip jika perlu. |
+-------------------------------------------------------------------+
| Ajak teman-teman Anda bergabung dengan mengirim e-mail kosong ke |
| XL-mania-subscribe@yahoogroups.com atau kirimkan mereka file dari |
| http://groups.yahoo.com/group/XL-mania/files/Promotion/ |
+-------------------------------------------------------------------+
| Berikan testimoni di : http://www.friendster.com/xlmania atau... |
| http://www.xl-mania.com/2008/06/testimoni-xl-mania.html |
+-------------------------------------------------------------------+
| Message lama ada di : |
| http://groups.yahoo.com/group/XL-mania/messages [perlu yahoo id] |
| http://www.mail-archive.com/xl-mania@yahoogroups.com |
+-------------------------------------------------------------------+
.
__,_._,___
Nenhum comentário:
Postar um comentário