masih salah ya...
soalnya dibuat langsung di email editor & tidak ditest
lengkapnya, jika ditulis di module standard, spt ini
Sub Cari3()
Dim i As Long
With ActiveSheet.ComboBox1
.ListIndex = -1
For i = 0 To .ListCount - 1
If .List(i) = ActiveSheet.TextBox1 Then
.ListIndex = i
Exit For
End If
Next i
If .ListIndex = -1 Then _
MsgBox "tidak ada item spt di texbox1", 48
End With
End Sub
--------------------------------------------------------------------------------
----- Original Message -----
From: siti Vi
To: [email protected]
Sent: Saturday, February 27, 2010 11:34 AM
Subject: Re: [belajar-excel] Combo box
ralat & koreksi
jawaban no. 2 a; seharusnya sbb:
Dengan cara mencari melalui looping
dim i as long
with combobox1
.listindex = -1
for i = 0 to .ListCount -1
if .ListIndex(i) = TextBox1 then
.ListIndex = i
exit for
end if
next i
if .listindex = -1 then _
msgbox "tidak ada item spt di texbox1", 48
end with