[belajar-excel] Mencari string dalam Listbox

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[belajar-excel] Mencari string dalam Listbox

Heru Safrudin
Dear Master

Bagaimana cara mencari string dalam Listbox yang posisi string
tersebut berada di kolom ketiga :
Saya coba code dibawah kok  cuma kolom 1 yang dicari

ListBox2.BoundColumn = 3
A=1
For Each SESUATU In ListBox2.List
    If InStr(SESUATU, "string") > 0 Then
        ListBox2.ListIndex = A - 1
        Exit Sub
    Else
        A = A + 1
    End If
Next


--
Terima kasih

وَالسَّلَامُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ
Heru Safrudin


------------------------------------

---------------------------------------------------------------------
bergabung ke milis (subscribe), kirim mail kosong ke:
[hidden email]

posting ke milis, kirimkan ke:
[hidden email]

berkunjung ke web milis
http://tech.groups.yahoo.com/group/belajar-excel/messages

melihat file archive / mendownload lampiran
http://www.mail-archive.com/belajar-excel@.../
atau (sejak 25-Apr-2011) bisa juga di :
http://milis-belajar-excel.1048464.n5.nabble.com/

menghubungi moderators & owners: [hidden email]

keluar dari membership milis (UnSubscribe):
kirim mail kosong ke  [hidden email]
---------------------------------------------------------------------Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/belajar-excel/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/belajar-excel/join
    (Yahoo! ID required)

<*> To change settings via email:
    [hidden email]
    [hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Kid
Reply | Threaded
Open this post in threaded view
|

Re: [belajar-excel] Mencari string dalam Listbox

Kid
Administrator
Hai Heru,

Coba :
dim lIdx as long
for lIdx=0 to listbox2.listcount-1
     '.list(row_index,col_index) bisa diganti .column(col_idx,row_index)
     'row_index dan col_index seluruhnya base 0 (item pertama bernilai
index 0)
     if instr(listbox2.list(lidx,2),"string")<>0 then
           listbox2.listindex=lidx
           exit for
     endif
next lidx

Wassalam,
Kid.

2013/2/12 Heru Safrudin <[hidden email]>

> Dear Master
>
> Bagaimana cara mencari string dalam Listbox yang posisi string
> tersebut berada di kolom ketiga :
> Saya coba code dibawah kok  cuma kolom 1 yang dicari
>
> ListBox2.BoundColumn = 3
> A=1
> For Each SESUATU In ListBox2.List
>     If InStr(SESUATU, "string") > 0 Then
>         ListBox2.ListIndex = A - 1
>         Exit Sub
>     Else
>         A = A + 1
>     End If
> Next
>
>
> --
> Terima kasih
>
> وَالسَّلَامُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ
> Heru Safrudin
>
>
> ------------------------------------
>
> ---------------------------------------------------------------------
> bergabung ke milis (subscribe), kirim mail kosong ke:
> [hidden email]
>
> posting ke milis, kirimkan ke:
> [hidden email]
>
> berkunjung ke web milis
> http://tech.groups.yahoo.com/group/belajar-excel/messages
>
> melihat file archive / mendownload lampiran
> http://www.mail-archive.com/belajar-excel@.../
> atau (sejak 25-Apr-2011) bisa juga di :
> http://milis-belajar-excel.1048464.n5.nabble.com/
>
> menghubungi moderators & owners: [hidden email]
>
> keluar dari membership milis (UnSubscribe):
> kirim mail kosong ke  [hidden email]
> ---------------------------------------------------------------------Yahoo!
> Groups Links
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [belajar-excel] Mencari string dalam Listbox

Heru Safrudin
Oww iya juga....
Thanks Mr...

2013/2/12, Mr. Kid <[hidden email]>:

> Hai Heru,
>
> Coba :
> dim lIdx as long
> for lIdx=0 to listbox2.listcount-1
>      '.list(row_index,col_index) bisa diganti .column(col_idx,row_index)
>      'row_index dan col_index seluruhnya base 0 (item pertama bernilai
> index 0)
>      if instr(listbox2.list(lidx,2),"string")<>0 then
>            listbox2.listindex=lidx
>            exit for
>      endif
> next lidx
>
> Wassalam,
> Kid.
>
> 2013/2/12 Heru Safrudin <[hidden email]>
>
>> Dear Master
>>
>> Bagaimana cara mencari string dalam Listbox yang posisi string
>> tersebut berada di kolom ketiga :
>> Saya coba code dibawah kok  cuma kolom 1 yang dicari
>>
>> ListBox2.BoundColumn = 3
>> A=1
>> For Each SESUATU In ListBox2.List
>>     If InStr(SESUATU, "string") > 0 Then
>>         ListBox2.ListIndex = A - 1
>>         Exit Sub
>>     Else
>>         A = A + 1
>>     End If
>> Next
>>
>>
>> --
>> Terima kasih
>>
>> وَالسَّلَامُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ
>> Heru Safrudin
>>
>>
>> ------------------------------------
>>
>> ---------------------------------------------------------------------
>> bergabung ke milis (subscribe), kirim mail kosong ke:
>> [hidden email]
>>
>> posting ke milis, kirimkan ke:
>> [hidden email]
>>
>> berkunjung ke web milis
>> http://tech.groups.yahoo.com/group/belajar-excel/messages
>>
>> melihat file archive / mendownload lampiran
>> http://www.mail-archive.com/belajar-excel@.../
>> atau (sejak 25-Apr-2011) bisa juga di :
>> http://milis-belajar-excel.1048464.n5.nabble.com/
>>
>> menghubungi moderators & owners: [hidden email]
>>
>> keluar dari membership milis (UnSubscribe):
>> kirim mail kosong ke  [hidden email]
>> ---------------------------------------------------------------------Yahoo!
>> Groups Links
>>
>>
>>
>>
>


--
Terima kasih

وَالسَّلَامُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ
Heru Safrudin