Buat variabel grup dan prosedur changechk untuk masing-masing grup checkbox dengan nama variabel dan prosedur yang unique
On Thu, Sep 29, 2016 at 9:08 AM, [email protected] [belajar-excel] < [email protected]> wrote: > > > Terima kasih Mr.Kid, kalau saya amati dicontoh tersebut untuk chekboxnya > ada satu grup, kalau ada beberap group checkbox cekripnya gimana Mr.Kir..? > saya coba membuat 3 group checkbox > > Berikut cekrip dari Mr.Kid > > > > Private bChange As Boolean, chkGroup(1 To 3) As Control > > > > Private Sub UserForm_Initialize() > > bChange = False > > Set chkGroup(1) = chk1 > > Set chkGroup(2) = chk2 > > Set chkGroup(3) = chk3 > > End Sub > > > > Private Sub chk1_Change() > > ChangeChk 1 > > End Sub > > > > Private Sub chk2_Change() > > ChangeChk 2 > > End Sub > > > > Private Sub chk3_Change() > > ChangeChk 3 > > End Sub > > > > Private Sub ChangeChk(lIdx As Long) > > Dim lChk As Long, bState As Boolean > > > > If bChange Then > > Exit Sub > > End If > > > > If chkGroup(lIdx).Value Then > > bChange = True > > For lChk = 1 To 3 > > If lChk <> lIdx Then 'selain checkbox yang diubah user > > chkGroup(lChk).Value = False > > End If > > Next lChk > > bChange = False > > Else 'kalau mau set agar selalu ada yang di-checked, setidaknya > checkbox setelahnya > > If lIdx = 3 Then > > lIdx = 0 > > End If > > chkGroup(lIdx + 1) = True > > End If > > End Sub > > > > Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for > Windows 10 > > > > *From: *'Mr. Kid' [email protected] [belajar-excel] > <[email protected]> > *Sent: *Sabtu, 24 September 2016 15.49 > *To: *BeExcel <[email protected]> > *Subject: *Re: [belajar-excel] menampilkan data di listbox sesuai apa > yang dicheckbox > > > > > > Coba lihat file yang ada disini > <https://app.box.com/s/a0lf5qh7awv4hl7h4us4yfbtq7st8y6j>. > > Regards, > > Kid > > > > 2016-09-24 9:54 GMT+07:00 [email protected] [belajar-excel] < > [email protected]>: > > > > Selamat siang sedulur dan para master > > Mohon bantuannya bagaimana cara menampildan data di listbox sesuai pilihan > yang ada pada checkbox, serta checkbox dengan cara bergantian dengan kata > lain checkbox hanya bias di check salah satu...file berikut saya lampirkan > dan sudah ada sedikit cekripnya yang saya copas dari beberapa web dan saya > modif sedikit sedikit karena masih belum mudeng dengan macro VBA.. > > > > Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for > Windows 10 > > > > > > > > >

