SCRIPT APA YANG HARUS DIGUNAKAN?

  1. 2 tahun lalu
    Di sunting 2 tahun lalu oleh Oqi

    Apa Scriptnya untuk TeksBoxs N I S Agar Bisa berurutan, contohnya :

    1. 1617010001
    2. 1617010002

    Dan Seterusnya..

    Bila Scriptnya Seperti ini
    Mohon pencerahannya dari master VBA Excel...

    Private Sub CBNO_Click()
    Tnis.Value = ""
    Tnisn.Value = ""
    Tnama.Value = ""
    Ttempat.Value = ""
    Ttanggal.Value = ""
    Cbsex.Value = ""
    Tagama.Value = ""
    Tke.Value = ""
    Tdari.Value = ""
    Ttlp.Value = ""
    Talamat.Value = ""
    Trt.Value = ""
    Trw.Value = ""
    Tkel.Value = ""
    Tkec.Value = ""
    Tkab.Value = ""
    Tprop.Value = ""
    Ttinggal.Value = ""
    Tayah.Value = ""
    Tpendayah.Value = ""
    Tpekayah.Value = ""
    Tibu.Value = ""
    Tpendibu.Value = ""
    Tpekibu.Value = ""
    Thasil.Value = ""
    Thp.Value = ""
    Tdarsek.Value = ""
    Tlama.Value = ""
    Tpindah.Value = ""
    Tsuratpndh.Value = ""
    Talasan.Value = ""
    Tkelas.Value = ""
    Ttanggalkel.Value = ""
    Cbkeg.Value = ""
    Tbea.Value = ""
    Ttglmen.Value = ""
    Talsn.Value = ""
    Ttbt.Value = ""
    Tseri.Value = ""
    
    
    Application.ScreenUpdating = True
    
    End Sub
    
    Private Sub CBSAVE_Click()
    Dim Barisawal As Range, BarisAkhir As Long, X As Long
    
    Set Barisawal = Sheet2.Range("A1").CurrentRegion
    BarisAkhir = Barisawal.Rows.Count
    X = BarisAkhir + 1
    With Sheet2
    .Cells(X, 1).Value = X - 1
    .Cells(X, 2).Value = FORMENTRY.Tnis.Value
    .Cells(X, 3).Value = FORMENTRY.Tnisn.Value
    .Cells(X, 4).Value = FORMENTRY.Tnama.Value
    .Cells(X, 5).Value = FORMENTRY.Ttempat.Value
    .Cells(X, 6).Value = FORMENTRY.Ttanggal.Value
    .Cells(X, 7).Value = FORMENTRY.Cbsex.Value
    .Cells(X, 8).Value = FORMENTRY.Tagama.Value
    .Cells(X, 9).Value = FORMENTRY.Tke.Value
    .Cells(X, 10).Value = FORMENTRY.Tdari.Value
    .Cells(X, 11).Value = FORMENTRY.Ttlp.Value
    .Cells(X, 12).Value = FORMENTRY.Talamat.Value
    .Cells(X, 13).Value = FORMENTRY.Trt.Value
    .Cells(X, 14).Value = FORMENTRY.Trw.Value
    .Cells(X, 15).Value = FORMENTRY.Tkel.Value
    .Cells(X, 16).Value = FORMENTRY.Tkec.Value
    .Cells(X, 17).Value = FORMENTRY.Tkab.Value
    .Cells(X, 18).Value = FORMENTRY.Tprop.Value
    .Cells(X, 19).Value = FORMENTRY.Ttinggal.Value
    .Cells(X, 20).Value = FORMENTRY.Tayah.Value
    .Cells(X, 21).Value = FORMENTRY.Tpendayah.Value
    .Cells(X, 22).Value = FORMENTRY.Tpekayah.Value
    .Cells(X, 23).Value = FORMENTRY.Tibu.Value
    .Cells(X, 24).Value = FORMENTRY.Tpendibu.Value
    .Cells(X, 25).Value = FORMENTRY.Tpekibu.Value
    .Cells(X, 26).Value = FORMENTRY.Thasil.Value
    .Cells(X, 27).Value = FORMENTRY.Thp.Value
    .Cells(X, 28).Value = FORMENTRY.Tdarsek.Value
    .Cells(X, 29).Value = FORMENTRY.Tlama.Value
    .Cells(X, 30).Value = FORMENTRY.Tpindah.Value
    .Cells(X, 31).Value = FORMENTRY.Tsuratpndh.Value
    .Cells(X, 32).Value = FORMENTRY.Talasan.Value
    .Cells(X, 33).Value = FORMENTRY.Tkelas.Value
    .Cells(X, 34).Value = FORMENTRY.Ttanggalkel.Value
    .Cells(X, 35).Value = FORMENTRY.Cbkeg.Value
    .Cells(X, 36).Value = FORMENTRY.Tbea.Value
    .Cells(X, 37).Value = FORMENTRY.Ttglmen.Value
    .Cells(X, 38).Value = FORMENTRY.Talsn.Value
    .Cells(X, 39).Value = FORMENTRY.Ttbt.Value
    .Cells(X, 40).Value = FORMENTRY.Tseri.Value
    
    
    
    'CLEAR DATA
    Tnis.Value = ""
    Tnisn.Value = ""
    Tnama.Value = ""
    Ttempat.Value = ""
    Ttanggal.Value = ""
    Cbsex.Value = ""
    Tagama.Value = ""
    Tke.Value = ""
    Tdari.Value = ""
    Ttlp.Value = ""
    Talamat.Value = ""
    Trt.Value = ""
    Trw.Value = ""
    Tkel.Value = ""
    Tkec.Value = ""
    Tkab.Value = ""
    Tprop.Value = ""
    Ttinggal.Value = ""
    Tayah.Value = ""
    Tpendayah.Value = ""
    Tpekayah.Value = ""
    Tibu.Value = ""
    Tpendibu.Value = ""
    Tpekibu.Value = ""
    Thasil.Value = ""
    Thp.Value = ""
    Tdarsek.Value = ""
    Tlama.Value = ""
    Tpindah.Value = ""
    Tsuratpndh.Value = ""
    Talasan.Value = ""
    Tkelas.Value = ""
    Ttanggalkel.Value = ""
    Cbkeg.Value = ""
    Tbea.Value = ""
    Ttglmen.Value = ""
    Talsn.Value = ""
    Ttbt.Value = ""
    Tseri.Value = ""
    
    
    MsgBox " DATA PENDAFTAR BERHASIL DISIMPAN ", vbOKOnly, "SIMPAN"
    ThisWorkbook.Save
    
    'Tnopend.SetFocus
    End With
    Application.ScreenUpdating = True
    
    End Sub
    
    Private Sub CBCARI_Click()
    On Error Resume Next
    Dim Filter As String, Title As String, FileX As String
    
    X.SetFocus
    caridata = Me.Tcari.Value
    With Worksheets("INPUT").Range("A6:A393")
        Set c = .Find(caridata, LookIn:=xlValues)
        If Not c Is Nothing Then
        BARIS = c.Row
        
        Me.Tnis.Value = Worksheets("INPUT").Cells(BARIS, 2).Value
        Me.Tnisn.Value = Worksheets("INPUT").Cells(BARIS, 3).Value
        Me.Tnama.Value = Worksheets("INPUT").Cells(BARIS, 4).Value
        Me.Ttempat.Value = Worksheets("INPUT").Cells(BARIS, 5).Value
        Me.Ttanggal.Value = Worksheets("INPUT").Cells(BARIS, 6).Value
        Me.Cbsex.Value = Worksheets("INPUT").Cells(BARIS, 7).Value
        Me.Tagama.Value = Worksheets("INPUT").Cells(BARIS, 8).Value
        Me.Tke.Value = Worksheets("INPUT").Cells(BARIS, 9).Value
        Me.Tdari.Value = Worksheets("INPUT").Cells(BARIS, 10).Value
        Me.Ttlp.Value = Worksheets("INPUT").Cells(BARIS, 11).Value
        Me.Talamat.Value = Worksheets("INPUT").Cells(BARIS, 12).Value
        Me.Trt.Value = Worksheets("INPUT").Cells(BARIS, 13).Value
        Me.Trw.Value = Worksheets("INPUT").Cells(BARIS, 14).Value
        Me.Tkel.Value = Worksheets("INPUT").Cells(BARIS, 15).Value
        Me.Tkec.Value = Worksheets("INPUT").Cells(BARIS, 16).Value
        Me.Tkab.Value = Worksheets("INPUT").Cells(BARIS, 17).Value
        Me.Tprop.Value = Worksheets("INPUT").Cells(BARIS, 18).Value
        Me.Tayah.Value = Worksheets("INPUT").Cells(BARIS, 19).Value
        Me.Tpendayah.Value = Worksheets("INPUT").Cells(BARIS, 20).Value
        Me.Tpekayah.Value = Worksheets("INPUT").Cells(BARIS, 21).Value
        Me.Tibu.Value = Worksheets("INPUT").Cells(BARIS, 22).Value
        Me.Tpendibu.Value = Worksheets("INPUT").Cells(BARIS, 23).Value
        Me.Tpekibu.Value = Worksheets("INPUT").Cells(BARIS, 24).Value
        Me.Thasil.Value = Worksheets("INPUT").Cells(BARIS, 25).Value
        Me.Thp.Value = Worksheets("INPUT").Cells(BARIS, 26).Value
        Me.Tdarsek.Value = Worksheets("INPUT").Cells(BARIS, 27).Value
        Me.Tlama.Value = Worksheets("INPUT").Cells(BARIS, 28).Value
        Me.Tpindah.Value = Worksheets("INPUT").Cells(BARIS, 29).Value
        Me.Tsuratpndh.Value = Worksheets("INPUT").Cells(BARIS, 30).Value
        Me.Talasan.Value = Worksheets("INPUT").Cells(BARIS, 31).Value
        Me.Tkelas.Value = Worksheets("INPUT").Cells(BARIS, 32).Value
        Me.Ttanggalkel.Value = Worksheets("INPUT").Cells(BARIS, 33).Value
        Me.Cbkeg.Value = Worksheets("INPUT").Cells(BARIS, 34).Value
        Me.Tbea.Value = Worksheets("INPUT").Cells(BARIS, 35).Value
        Me.Ttglmen.Value = Worksheets("INPUT").Cells(BARIS, 36).Value
        Me.Talsn.Value = Worksheets("INPUT").Cells(BARIS, 37).Value
        Me.Ttbt.Value = Worksheets("INPUT").Cells(BARIS, 38).Value
        Me.Tseri.Value = Worksheets("INPUT").Cells(BARIS, 39).Value
        
     Else
     MsgBox "Maaf Nama dan data Pendaftar Yang Anda Cari tidak Ada"
     End If
     
    End With
    
    End Sub
    
    Private Sub CBUPDATE_Click()
    Dim kodenis
    Dim CellTujuan As Range
    kodependaftar = Tnis.Text
    Set CellTujuan = Range("A:C").Find(What:=kodenis)
    
    Cells(CellTujuan.Row, 2) = Tnis
    Cells(CellTujuan.Row, 3) = Tnisn
    Cells(CellTujuan.Row, 4) = Tnama
    Cells(CellTujuan.Row, 5) = Ttempat
    Cells(CellTujuan.Row, 6) = Ttanggal
    Cells(CellTujuan.Row, 7) = Cbsex
    Cells(CellTujuan.Row, 8) = Tagama
    Cells(CellTujuan.Row, 9) = Tke
    Cells(CellTujuan.Row, 10) = Tdari
    Cells(CellTujuan.Row, 11) = Ttlp
    Cells(CellTujuan.Row, 12) = Trt
    Cells(CellTujuan.Row, 13) = Trw
    Cells(CellTujuan.Row, 14) = Tkel
    Cells(CellTujuan.Row, 15) = Tkec
    Cells(CellTujuan.Row, 16) = Tkab
    Cells(CellTujuan.Row, 17) = Tprop
    Cells(CellTujuan.Row, 18) = Ttinggal
    Cells(CellTujuan.Row, 19) = Tayah
    Cells(CellTujuan.Row, 20) = Tpendayah
    Cells(CellTujuan.Row, 21) = Tpekayah
    Cells(CellTujuan.Row, 22) = Tibu
    Cells(CellTujuan.Row, 23) = Tpendibu
    Cells(CellTujuan.Row, 24) = Tpekibu
    Cells(CellTujuan.Row, 25) = Thasil
    Cells(CellTujuan.Row, 26) = Thp
    Cells(CellTujuan.Row, 27) = Tdarsek
    Cells(CellTujuan.Row, 28) = Tlama
    Cells(CellTujuan.Row, 29) = Tpindah
    Cells(CellTujuan.Row, 30) = Tsuratpndh
    Cells(CellTujuan.Row, 31) = Talsnpndh
    Cells(CellTujuan.Row, 32) = Tkelas
    Cells(CellTujuan.Row, 33) = Ttanggalkel
    Cells(CellTujuan.Row, 34) = Cbkeg
    Cells(CellTujuan.Row, 35) = Tbea
    Cells(CellTujuan.Row, 36) = Ttglmen
    Cells(CellTujuan.Row, 37) = Talsn
    Cells(CellTujuan.Row, 38) = Ttbt
    Cells(CellTujuan.Row, 39) = Tseri
    
    
    MsgBox " DATA PENDAFTAR PESERTA DIDIK BARU BERHASIL DI UPDATE ", vbOKOnly, "SIMPAN"
    ThisWorkbook.Save
    Application.ScreenUpdating = True
    
    End Sub
    
    Private Sub cbtanggal1_Click()
    g_bForm = True
    KALENDER.Show_Cal
    Ttanggal = Format(g_sDate, "dd-mm-yyyy")
    End Sub
    Private Sub cbtanggal2_Click()
    g_bForm = True
    KALENDER.Show_Cal
    Ttanggalkel = Format(g_sDate, "dd-mm-yyyy")
    End Sub
    
    
    
    'MENGIDENTIFIKASI FUNGSI COMBO LIST BY.Meitentei
    Private Sub UserForm_Initialize()
    Cbsex = ""
        With Cbsex
            .AddItem "Laki-Laki"
            .AddItem "Perempuan"
            End With
    
    
    Cbkec = ""
        With Cbkeg
            .AddItem "Seni"
            .AddItem "Olah Raga"
            .AddItem "Lainnya"
            End With
     
    End Sub
    
    Private Sub Cbsex_Change()
    Cbsex.Style = fmStyleDropDownList
    End Sub
    Private Sub CBKEg_Change()
    Cbkec.Style = fmStyleDropDownList
    End Sub

  2. tolong para master untuk pencerahannya pada masalah ini

  3. tghfox

    31 Agu 2016 Terverifikasi Bekasi Barat + 436 Poin

    buat sheet "master", pada cell A1 ketik "#Nomer Akhir" pada "B2" ketik "1617010001"

    pada tombol save tambah code berikut

    Cells(CellTujuan.Row, 2) = sheets("master").find("#Nomer Akhir").offset(0,1).value +1  
    sheets("master").find("#Nomer Akhir").offset(0,1).value + sheets("master").find("#Nomer Akhir").offset(0,1).value +1

    semoga berhasil

  4. saya lampirkan filenya yah

  5. sorry yg tdi ke protect

 

atau Mendaftar untuk ikut berdiskusi!