Jumat, 29 Agustus 2014

Excel Mine for WH - Barang Keluar

Private Sub cb_nama_barang_Change()
    Dim index As Integer
    index = cb_nama_barang.ListIndex
    tb_kode = Cells(index + 1000, 29).Value
    tb_unit = Cells(index + 1000, 30).Value
End Sub
Private Sub cmd_data_base_Click()
    ThisWorkbook.Application.Visible = True
    Worksheets("OUT").Activate
    FormOut.Hide
End Sub

Private Sub cmd_tambah_data_Click()

    Dim Wury As Long
    Worksheets("OUT").Activate
    Wury = WorksheetFunction.CountA(Range("A:A")) + 3
    Cells(Wury, 1).Value = tb_kode.Value
    Cells(Wury, 2).Value = cb_nama_barang.Value
    Cells(Wury, 3).Value = tb_unit.Value
    Cells(Wury, 4).Value = tb_tgl_terima.Value
    Cells(Wury, 5).Value = tb_jumlah.Value
    Cells(Wury, 9).Value = tb_ket
'=============================================================================



'==========================================================================================
    If chHR.Value = True Then Cells(Wury, 6).Value = "HR & GA"
    If chFTO.Value = True Then Cells(Wury, 6).Value = Cells(Wury, 6) & " " & chFTO.Caption
    If chPurchas.Value = True Then Cells(Wury, 6).Value = Cells(Wury, 6) & " " & chPurchas.Caption
    If chAP.Value = True Then Cells(Wury, 6).Value = Cells(Wury, 6) & " " & chAP.Caption
    If chCM.Value = True Then Cells(Wury, 6).Value = Cells(Wury, 6) & " " & chCM.Caption
    If chIT.Value = True Then Cells(Wury, 6).Value = Cells(Wury, 6) & " " & chIT.Caption
    If chFinP.Value = True Then Cells(Wury, 6).Value = Cells(Wury, 6) & " " & chFinP.Caption
    If chCR.Value = True Then Cells(Wury, 6).Value = Cells(Wury, 6) & " " & chCR.Caption
    If chLegal.Value = True Then Cells(Wury, 6).Value = Cells(Wury, 6) & " " & chLegal.Caption
    If chMKT.Value = True Then Cells(Wury, 6).Value = Cells(Wury, 6) & " " & chMKT.Caption
    If chProject.Value = True Then Cells(Wury, 6).Value = Cells(Wury, 6) & " " & chProject.Caption
    If chPFC.Value = True Then Cells(Wury, 6).Value = Cells(Wury, 6) & " " & chPFC.Caption
    If chEng.Value = True Then Cells(Wury, 6).Value = Cells(Wury, 6) & " " & chEng.Caption
    If chPFCE.Value = True Then Cells(Wury, 6).Value = Cells(Wury, 6) & " " & chPFCE.Caption
    If chFinDev.Value = True Then Cells(Wury, 6).Value = Cells(Wury, 6) & " " & chFinDev.Caption
    
  '===========================================================================================
    If ch_ekal.Value = True Then Cells(Wury, 7).Value = ch_ekal.Caption
    If ch_wuri.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_wuri.Caption
    If ch_qurni.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_qurni.Caption
    If ch_yana.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_yana.Caption
    If ch_lusi.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_lusi.Caption
    If ch_agust.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_agust.Caption
    If ch_dians.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_dians.Caption
    If ch_sis.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_sis.Caption
    If ch_indahm.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_indahm.Caption
    If ch_vicky.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_vicky.Caption
    If ch_sherly.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_sherly.Caption
    If ch_rickyf.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_rickyf.Caption
    If ch_setiyono.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_setiyono.Caption
    If ch_eko.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_eko.Caption
    If ch_febi.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_febi.Caption
    If ch_ana.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_ana.Caption
    If ch_sandra.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_sandra.Caption
    If ch_veni.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_veni.Caption
    If ch_adit.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_adit.Caption
    If ch_khalifa.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_khalifa.Caption
    If ch_restu.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_restu.Caption
    If ch_hermawan.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_hermawan.Caption
    If ch_clara.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_clara.Caption
    If ch_dewi.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_dewi.Caption
    If ch_agest.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_agest.Caption
    If ch_indah2.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_indah2.Caption
    If ch_dianr.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_dianr.Caption
    If ch_rita.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_rita.Caption
    If ch_mita.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_mita.Caption
    If ch_dhudi.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_dhudi.Caption
    If ch_dilla.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_dilla.Caption
    If ch_laras.Value = True Then Cells(Wury, 7).Value = Cells(Wury, 7) & " " & ch_laras.Caption
    
  '=============================================================================================
    If opInternal.Value = True Then
        Cells(Wury, 8).Value = "Internal"
    Else
        Cells(Wury, 8).Value = "External"
    End If
    Call BersihkanData
    Call Save
    End Sub
Private Sub opInternal_Click()
    Me.MultiPage1.Value = 0
End Sub
Private Sub opExternal_Click()
    Me.MultiPage1.Value = 1
End Sub
Private Sub chHR_Click() 'ketika checkbox HR di klik
    Me.MultiPage2.Value = 0 'maka multipage2 masuk ke page1
End Sub
Private Sub chFTO_Click()
    Me.MultiPage2.Value = 1
End Sub
Private Sub chPurchas_Click()
    Me.MultiPage2.Value = 2
End Sub
Private Sub chAP_Click()
    Me.MultiPage2.Value = 3
End Sub
Private Sub chCM_Click()
    Me.MultiPage2.Value = 4
End Sub
Private Sub chEng_Click()
    Me.MultiPage2.Value = 5
End Sub
Private Sub chIT_Click()
    Me.MultiPage2.Value = 6
End Sub
Private Sub chFinP_Click()
    Me.MultiPage2.Value = 7
End Sub
Private Sub chCR_Click()
    Me.MultiPage2.Value = 8
End Sub
Private Sub chPFC_Click()
    Me.MultiPage2.Value = 9
End Sub
Private Sub chLegal_Click()
    Me.MultiPage2.Value = 10
End Sub
Private Sub chMKT_Click()
    Me.MultiPage2.Value = 11
End Sub
Private Sub chFinDev_Click()
    Me.MultiPage2.Value = 12
End Sub
Private Sub chProject_Click()
    Me.MultiPage2.Value = 13
End Sub
Private Sub chPFCE_Click()
    Me.MultiPage2.Value = 14
End Sub
Private Sub SpinNilai_Change()
tb_jumlah.Text = SpinNilai.Value
End Sub




Private Sub BersihkanData()
    tb_kode.Value = ""
    cb_nama_barang.Value = ""
    tb_unit.Value = ""
    tb_tgl_terima.Value = ""
    tb_jumlah.Value = ""
    opInternal.Value = False
    opExternal.Value = False
    chHR.Value = False
    chFTO.Value = False
    chPurchas.Value = False
    chAP.Value = False
    chCM.Value = False
    chIT.Value = False
    chFinP.Value = False
    chCR.Value = False
    chLegal.Value = False
    chMKT.Value = False
    chProject.Value = False
    chPFC.Value = False
    chEng.Value = False
    chPFCE.Value = False
    chFinDev.Value = False
    ch_ekal.Value = False
    ch_wuri.Value = False
    ch_qurni.Value = False
    ch_yana.Value = False
    ch_lusi.Value = False
    ch_agust.Value = False
    ch_dians.Value = False
    ch_sis.Value = False
    ch_indahm.Value = False
    ch_vicky.Value = False
    ch_sherly.Value = False
    ch_rickyf.Value = False
    ch_setiyono.Value = False
    ch_eko.Value = False
    ch_febi.Value = False
    ch_ana.Value = False
    ch_sandra.Value = False
    ch_veni.Value = False
    ch_adit.Value = False
    ch_khalifa.Value = False
    ch_restu.Value = False
    ch_hermawan.Value = False
    ch_clara.Value = False
    ch_dewi.Value = False
    ch_agest.Value = False
    ch_indah2.Value = False
    ch_dianr.Value = False
    ch_rita.Value = False
    ch_mita.Value = False
    ch_dhudi.Value = False
    ch_dilla.Value = False
    ch_laras.Value = False
        
End Sub
Private Sub Save()
    ActiveWorkbook.Save
End Sub




Private Sub Error()
  
    If tb_tgl_terima.Value = "" Then
        MsgBox ("Silahkan Isi data Tanggal Brow!!!")
    End If
    
End Sub



Contoh : https://www.dropbox.com/s/3jopjs94o09qe52/Report%20ATK%20Juli%202014.xlsm?dl=0

Tidak ada komentar:

Posting Komentar