Siang Master Vi Saya memodifikasi Macro User Form milik Mbak, ini cobe yang asli Dim tbl As Range Private Sub UserForm_Initialize() Dim i As Long Set tbl = Sheets("Sheet1").Range("B5").CurrentRegion ComboBox1.Clear For i = 2 To tbl.Rows.Count ComboBox1.AddItem tbl(i, 2) Next End Sub Private Sub ComboBox1_Change() With ComboBox1 txtNo = tbl(.ListIndex + 2, 1) txtUmur = tbl(.ListIndex + 2, 3) txtAlm = tbl(.ListIndex + 2, 4) txtTelp = tbl(.ListIndex + 2, 5) End With End Sub dan ini code saya Option Explicit Dim tbl As Range Private Sub UserForm_Initialize() Dim i As Long Set tbl = Sheets("Master Cust.").Range("B2") '.CurrentRegion ComboBox1.Clear For i = 2 To tbl.Rows.Count ComboBox1.AddItem tbl(i, 2) Next End Sub Private Sub CommandButton1_Click() Range("d5").Select If txtNo = "" Then Unload Me Else ActiveCell = txtNo Unload Me Range("d6").Select End If End Sub Private Sub CommandButton2_Click() Unload Me End Sub Private Sub ComboBox1_Change() With ComboBox1 txtNo = tbl(.ListIndex + 2, 1) txtSales = tbl(.ListIndex + 2, 3) txtAlm = tbl(.ListIndex + 2, 9) txtTelp = tbl(.ListIndex + 2, 6) End With End Sub Code yang saya buat ini angin-anginan, kadang bisa kadang ngak... pada saat cmd button di klik selalu bug dan muncul pesan error run-time error 124.....(800....) type mismatch. saya coba telusuri, ternyata kalo code ".Currentregion" saya non aktifkan, form bisa tampil tapi pada combobox tidak nge-load ke sheet "Master Cust"....kira2 apa yang salah ya...? Mohon review dari Master Terima Kasih Anton --- Pada Kam, 17/2/11, STDEV(i) <setiyowati.devi@gmail.com> menulis:
|
| sorry... moderasi super lemot... momods lagi sakit parah... |
| buku terbaru XL mania: insipartif dan unik, gabungan antara buku |
| aplikasi bisnis dan buku komputer. isinya tidak biasa! |
| http://www.xl-mania.com/2011/02/mengapa-boss-benci-chart-anda.html|
| 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