T0 Lampiran Institutional Repository | Satya Wacana Christian University: Sistem Informasi Penginputan Data Pengiriman Faktur Penjualan PT Coca Cola Amatil Indonesia dengan Macro Excel

LAMPIRAN
1.

Coding Pembuatan sistem


Buka Ms. Excel, simpan dengan nama PENGIRIMAN INVOICE KE BU
TIM TIM.xlsm





Tekan tombol Alt + F11 untuk membuka jendela Visual Basic Editor.
Klik menu Insert – Module untuk menyisipkan lembar kerja modul.
kemudian sisipkan sebuah prosedur dengan nama FORMAT dengan TIPE
Sub dan ketik kode macro di dalam prosedur tersebut sebagai berikut :

Public Sub FORMAT()
'MASUKKAN TEKS LAPORAN PENGIRIMAN INVOICE
Cells(1, 1).Select

ActiveCell.Value = "LAPORAN PENGIRIMAN INVOICE"
Range("A1:F1").Select
Selection.Font.Bold = True
Selection.Font.Italic = False
Selection.HorizontalAlignment = xlCenter
Selection.Merge
'BERPINDAH 2 BARIS KE BAWAH
ActiveCell.Offset(2, 0).Select
'MASUKKAN TEKS SALES OFFICER
ActiveCell.Value = "SALES OFFICER"
Selection.Font.Italic = False
'BERPINDAH 2 BARIS KE KANAN
ActiveCell.Offset(0, 2).Select
'MASUKKAN TEKS FINANCE
ActiveCell.Value = "FINANCE"
Selection.Font.Italic = False
'BERPINDAH 1 SEL KEBAWAH DAN 2 BARIS KE KIRI
ActiveCell.Offset(1, -2).Select
'MASUKKAN TEKS TANGGAL PENGIRIMAN
ActiveCell.Value = "TANGGAL PENGIRIMAN"

'BERPINDAH 1 KOLOM KE KANAN
ActiveCell.Offset(0, 2).Select
'MASUKKAN FORMAT TANGGAL
Range("C4") = Now
Range("C4").NumberFormat = "D/M/YYYY"
Selection.HorizontalAlignment = xlLeft
Selection.Font.Italic = False
'BERPINDAH 2 KOLOM KEBAWAH DAN 1 BARIS KE KIRI
ActiveCell.Offset(2, -2).Select
'MASUKKAN TEKS NO
ActiveCell.Value = "NO"
Selection.Font.Italic = False
'BERPINDAH 1 BARIS KE KANAN
ActiveCell.Offset(0, 1).Select
'MASUKKAN TEKS NAMA OUTLET
ActiveCell.Value = "NAMA OUTLET"
Selection.Font.Italic = False
'BERPINDAH 1 BARIS KE KANAN
ActiveCell.Offset(0, 1).Select
'MASUKKAN TEKS TANGGAL INVOICE

ActiveCell.Value = "TANGGAL INVOICE"
ActiveCell.NumberFormat = "M/D/YYYY"
Selection.Font.Italic = False
'BERPINDAH 1 BARIS KE KANAN
ActiveCell.Offset(0, 1).Select
'MASUKKAN TEKS NO INVOICE

26

ActiveCell.Value = "NO INVOICE"
Selection.Font.Italic = False
'BERPINDAH 1 BARIS KE KANAN
ActiveCell.Offset(0, 1).Select
'MASUKKAN TEKS NO BPB
ActiveCell.Value = "NO BPB"
Selection.Font.Italic = False
'BERPINDAH 1 BARIS KE KANAN
ActiveCell.Offset(0, 1).Select
'MASUKKAN TEKS NOMINAL
ActiveCell.Value = "NOMINAL"

Selection.Font.Italic = False
'BERPINDAH 1 KOLOM KE BAWAH DAN 5 BARIS KE KIRI
Columns("B:F").EntireColumn.AutoFit
Columns("G:H").Select
With Selection.Font
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
End With
Call INPUT_INVOICE.Show
End Sub



Klik menu Insert – UserForm untuk menyisipkan UserForm. Kemudian
atur Desainnya seperti pada gambar dibawah ini :



Pada saat UserForm dijalankan, maka anda dapat mengetikkan data pada
masing-masing bagian. Untuk proses memindahkan data input dari form

ke lembar kerja Ms. Excel, dapat anda masukkan perintah pada Button
Tambah dengan ketentuan sebagai berikut :

Private Sub CMD_TAMBAH_Click()
'DARI POSISI SEL AKTIF TURUN 1 BARIS DAN 5 KOLOM KE KIRI
nokode = Me.TextBox1.Value + 1
Range("a6").Select

27

ActiveCell.Offset(1, 0).Select
If ActiveCell.Value = "" Then
Range("f6").Select
Else
Range("F6").Select
Selection.End(xlDown).Select
End If
ActiveCell.Offset(1, -5).Select
'MASUKKAN NO URUT DARI TEXTBOX KE SEL AKTIF
ActiveCell.Value = TNO.Text

'BERPINDAH 1 KOLOM KEKANAN (KOLOM NAMA OUTLET)
ActiveCell.Offset(0, 1).Select
'MASUKKAN NAMA OUTLET DARI COMBO BOX KE SEL AKTIF
ActiveCell.Value = cmbnama.Text
Selection.Font.Bold = True
'BERPINDAH 1 KOLOM KEKANAN (KOLOM TANGGAL INVOICE)
ActiveCell.Offset(0, 1).Select
'MASUKKAN TANGGAL INVOICE DARI TEXTBOX KE SEL AKTIF
ActiveCell.Value = TTGL.Text
ActiveCell.NumberFormat = "M/D/YYYY"
'BERPINDAH 1 KOLOM KEKANAN (KOLOM NO INVOICE)
ActiveCell.Offset(0, 1).Select
'MASUKKAN NO INVOICE DARI TEXTBOX KE SEL AKTIF
ActiveCell.Value = TINVOICE.Text
'BERPINDAH 1 KOLOM KEKANAN (KOLOM NO BPB)
ActiveCell.Offset(0, 1).Select
Selection.NumberFormat = "0"
'MASUKKAN NO BPB DARI TEXTBOX KE SEL AKTIF
ActiveCell.Value = TBPB.Text
'BERPINDAH 1 KOLOM KEKANAN (KOLOM NOMINAL)

ActiveCell.Offset(0, 1).Select
'MASUKKAN NOMINAL DARI TEXTBOX KE SEL AKTIF
ActiveCell.Value = TNOMINAL.Text
Columns("F:F").Style = "COMMA [0]"
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = nokode
'MENGOSONGKAN SEMUA TEXTBOX
TNO.Text = ""
cmbnama.Text = ""
TTGL.Text = ""
TINVOICE.Text = ""
TBPB.Text = ""
TNOMINAL.Text = ""
'MEMINDAHKAN POSISI AKTIF PADA TEXTBOX NO
TNO.SetFocus
Columns("B:F").EntireColumn.AutoFit
Range("A6:F6").Select
borderinputawal
Range("A7").Select
ActiveCell.Offset(1, 0).Select

If ActiveCell.Value = "" Then
NOMER = 1
Else
NOMER = 2
End If
Range("A7").Select
Range("A6").Select
If NOMER = 1 Then
bordersheetinput
Else
bordersheetinputall
End If
Me.TextBox1.Value = Me.TextBox1.Value + 1
End Sub



Buat prosedur dengan nama borderinputawal dengan tipe sub, untuk
border tiap input data, lalu ketik perintah di bawah ini :


28

Public Sub borderinputawal()
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin

End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
Selection.Font.Bold = True

With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
End Sub

2.

Buat prosedur dengan nama bordersheetinput dengan tipe sub, untuk border
tiap satu kali input data, lalu ketik perintah di bawah ini :
Public Sub bordersheetinput()
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0

29

.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
End Sub

3.

Buat prosedur dengan nama bordersheetinputall dengan tipe sub, untuk
border lebih dari satu input data, lalu ketik perintah di bawah ini :
Public Sub bordersheetinputall()
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)

30

.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
End Sub

4.

Untuk Copy All buat Workbook baru dengan nama PENGIRIMAN
INVOICE ALL.xlsm dan masukkan perintah pada button COPY_ALL
dengan ketentuan sebagai berikut :
Private Sub CMD_COPY_Click()
Range("A7").Select
ActiveCell.Offset(1, 0).Select
If ActiveCell.Value = "" Then
NOMER = 1
Else
NOMER = 2
End If
Range("B7").Select
If NOMER = 1 Then
Range(Selection, Selection.End(xlToRight)).Select
Else
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
End If
Selection.Copy
bukafileall
'pilih sel
Range("b3").Select
ActiveCell.Offset(1, 0).Select
If ActiveCell.Value = "" Then
NO = 1
Else
NO = 2
End If
If NO = 1 Then
Range("b3").Select
ActiveSheet.Paste
ActiveCell.Offset(0, -1).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveCell = Now
ActiveCell.NumberFormat = "D/M/YYYY"
'tinggal memberi border saja untuk 1 cells
ActiveCell.Offset(0, 1).Select
bordersheetsatu
Else
Range("b3").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
ActiveCell.Offset(0, -1).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveCell = Now
ActiveCell.NumberFormat = "D/M/YYYY"
ActiveCell.Offset(0, 1).Select
bordersheetall
cptgl
End If
tutupfileall
End Sub

5.

Buat prosedur dengan nama bukafile dengan tipe sub, untuk membuka File
PENGIRIMAN INVOICE ALL.xlsm, lalu ketik perintah di bawah ini :

31

Public Sub bukafileall()
Workbooks.Open Filename:="E:\TUGAS AKHIR 10-01-2015\TA
INVOICE ALL.xlsm"
Windows("PENGIRIMAN INVOICE ALL.xlsm").Activate
End Sub

6.

FIX\PENGIRIMAN

Buat prosedur dengan nama bordersheetsatu dengan tipe sub, untuk
memberi border satu sel saja, lalu ketik perintah di bawah ini :
Public Sub bordersheetsatu()
Range(Selection, Selection.End(xlToRight)).Select
'Range(Selection, Selection.End(xlDown)).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
End Sub

7.

Buat prosedur dengan nama bordersheetall dengan tipe sub, untuk memberi
border lebih dari satu sel, lalu ketik perintah di bawah ini :
Public Sub bordersheetall()
Range("A4").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous

32

.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
End Sub

8.

Buat prosedur dengan nama cptgl dengan tipe sub, untuk format tanggal,
lalu ketik perintah di bawah ini :
Public Sub cptgl()
Range("b4").Select
Selection.End(xlDown).Select
r2 = ActiveCell.Row
'MsgBox r2
ActiveCell.Offset(0, -1).Select
Selection.End(xlUp).Select
r1 = ActiveCell.Row
r3 = r2 - r1
For a = 0 To r3
Selection.Copy
'jalankan Copy
'turunkan 1
'paste
'MsgBox "jalan ke " & r3
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
a = a + 1
Next a
End Sub

33

9.

Buat prosedur dengan nama tutupfile dengan tipe sub, untuk menutup File
PENGIRIMAN INVOICE ALL.xlms, lalu ketik perintah di bawah ini :
Public Sub tutupfileall()
Windows("PENGIRIMAN INVOICE ALL.xlsm").Activate
ActiveWindow.Close
Windows("PENGIRIMAN INVOICE KE BU TIM TIM.xlsm").Activate
End Sub

10.

Untuk Button EDIT_DATA masukkan perintah sebagai berikut :

Private Sub EDIT_DATA_Click()
'AKTIF PADA SEL KOSONG DIATAS JUDUL KOLOM PERTAMA
Range("G5").Select
'MENAMPILKAN INPUT BOX UNTUK MENANMPUNG NILAI RECORD DATA YANG AKAN DI EDIT
ActiveCell.Value = InputBox("EDIT RECORD BERAPA?", "EDIT DATA", NILAI)
'MENGENALKAN VARIABEL
NILAI = ActiveCell.Value
'BERPINDAH KE BARIS DATA YANG DIEDIT DARI POSISI SEL AKTIF
'NILAI 1 DIDAPAT DARI JUMLAH BARIS JUDUL KOLOM PERTAMA
ActiveCell.Offset(NILAI + 1, -6).Select
'MENAMPILKAN DATA PADA USER FORM
'MENAMPILKAN DATA NO PADA TEXT BOX
TNO.Text = ActiveCell.Value
'BERPINDAH KE KOLOM NAMA OUTLET
ActiveCell.Offset(0, 1).Select
'MENAMPILKAN DATA NAMA OUTLET PADA COMBOBOX
cmbnama.Text = ActiveCell.Value
'BERPINDAH KE KOLOM TANGGAL
ActiveCell.Offset(0, 1).Select
ActiveCell.NumberFormat = "D/M/YYYY"
'MENAMPILKAN DATA TANGGAL PADA TEXT BOX
TTGL.Text = ActiveCell.Value
'BERPINDAH KE KOLOM NO INVOICE
ActiveCell.Offset(0, 1).Select
'MENAMPILKAN DATA NO INVOICE PADA TEXTBOX
TINVOICE.Text = ActiveCell.Value
'BERPINDAH KE KOLOM NO BPB
ActiveCell.Offset(0, 1).Select
'MENAMPILKAN DATA NO BPB PADA TEXTBOX
TBPB.Text = ActiveCell.Value
'BERPINDAH KE KOLOM NOMINAL
ActiveCell.Offset(0, 1).Select
'MENAMPILKAN DATA NOMINAL PADA TEXTBOX
TNOMINAL.Text = ActiveCell.Value
'BERPINDAH KE SEL NO
ActiveCell.Offset(0, -5).Select
End Sub

11.

Untuk button BENAR pada Column G di Workbook PENGIRIMAN
INVOICE KE BU TIM TIM.xlsm dan di column G Workbook
PENGIRIMAN INVOICE ALL.xlsm terdapat kode yang berwana putih,
masukkan perintah sebagai berikut :

Private Sub CMD_BENAR_Click()
'MEMINDAHKAN DATA YANG DIEDIT DARI TEXTBOX KE TIAP SEL
ActiveCell.Value = TNO.Text
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = cmbnama.Text

34

ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TTGL.Text
ActiveCell.NumberFormat = "D/M/YYYY"
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TINVOICE.Text
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TBPB.Text
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TNOMINAL.Text
ActiveCell.Offset(0, 1).Select
kodecari = ActiveCell.Value
'BENARKAN YG ALL
'BUKA FILE
bukafileall
'MENCARI SESUAI DENGAN KODE di range G
Columns("G:G").Select
Selection.Find(What:=kodecari,After:=ActiveCell,
LookIn:=xlFormulas, LookAt _
:=xlPart,
SearchOrder:=xlByRows,
SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(0, -5).Select
'ISI DENGAN DATA YANG BENAR
ActiveCell.Value = Me.cmbnama.Text
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = Me.TTGL.Text
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = Me.TINVOICE.Text
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = Me.TBPB.Text
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = Me.TNOMINAL.Text
tutupfileall
'MENGOSONGKAN SEMUA TEXTBOX DAN COMBO BOX
TNO.Text = ""
cmbnama.Text = ""
TTGL.Text = ""
TINVOICE.Text = ""
TBPB.Text = ""
TNOMINAL.Text = ""
'MEMINDAHKAN POSISI AKTIF PADA TEXTBOX NO
TNO.SetFocus
End Sub

12.

Untuk Button SIMPAN masukkan perintah sebagai berikut :

Private Sub CMD_SIMPAN_Click()
Windows("PENGIRIMAN INVOICE KE BU TIM TIM.xlsm").Activate
BORDER
Unload Me
End Sub

13.

Buat prosedur dengan nama BORDER pada Module dengan tipe sub, untuk
memberi borderdan format di bawah data, masukkan perintah di bawah ini :

Public Sub BORDER()
'MEMILIH MULAI DARI SEL AKTIF SAMPAI DENGAN KE KIRI PADA SEL PERTAMA BERISI
DATA
Range("A7").Select
ActiveCell.Offset(1, 0).Select
If ActiveCell.Value = "" Then
NOMER = 1
Else
NOMER = 2

35

End If
Range("B7").Select
If NOMER = 1 Then
Else
Selection.End(xlDown).Select
End If
'BERPINDAH DARI AWAL KE 2 BARIS SETELAH DATA
ActiveCell.Offset(2, 0).Select
'MASUKKAN TEKS BAWEN,
ActiveCell.Value = "Bawen,"
'BERPINDAH KE KOLOM SEBELAH KANAN
ActiveCell.Offset(0, 1).Select
'MASUKKAN PERINTAH
ActiveCell = Now
ActiveCell.NumberFormat = "D/M/YYYY"
Selection.HorizontalAlignment = xlLeft
'BERPINDAH 1 BARIS KE BAWAH
ActiveCell.Offset(1, 0).Select
'MASUKKAN TEKS PENGIRIM
ActiveCell.Value = "PENGIRIM"
'BERPINDAH 3 BARIS KE KANAN
ActiveCell.Offset(0, 3).Select
'MASUKKAN TEKX PENERIMA
ActiveCell.Value = "PENERIMA"
'BERPINDAH 3 BARIS KE BAWAH DAN 3 KOLOM KE KANAN
ActiveCell.Offset(3, -3).Select
'MASUKKAN TEKS "NAMA PENGIRIM"
ActiveCell.Value = "YUNI"
'BERPINDAH 3 BARIS KE KANAN
ActiveCell.Offset(0, 3).Select
'MASUKKAN TEKS "NAMA PENERIMA"
ActiveCell.Value = "TIM TIM"
End Sub

14.

Untuk Button HAPUS_DATA masukkan perintah sebagai berikut :

Private Sub HAPUS_DATA_Click()
'AKTIF PADA SEL KOSONG DI ATAS JUDUL KOLOM PERTAMA
Range("G5").Select
'MENAMPILKAN INPUTBOX UNTUK MENAMPUNG NILAI RECORD DATA YANG AKAN DIHAPUS
ActiveCell.Value = InputBox("HAPUS RECORD BERAPA?", "HAPUS DATA", NILAI)
'MENGENALKAN VARIABEL
NILAI = ActiveCell.Value
'BERPINDAH KE BARIS DATA YANG DIEDIT DARI POSISI SEL AKTIF
'NILAI 1 DIDAPAT DARI JUMLAH BARIS JUDUL KOLOM PERTAMA
ActiveCell.Offset(NILAI + 1, -6).Select
'KONFIRMASI PENGHAPUSAN DATA
HAPUS = MsgBox("DATA BENAR DIHAPUS?", vbYesNo, "HAPUS DATA")
If HAPUS = vbYes Then
ActiveCell.Offset(0, 6).Select
kodecari = ActiveCell.Value
ActiveCell.Offset(0, -6).Select
ActiveCell.EntireRow.Delete
bukafileall
'MENCARI SESUAI DENGAN KODE di Column G
Columns("G:G").Select
Selection.Find(What:=kodecari,
After:=ActiveCell,
LookIn:=xlFormulas,
LookAt _
:=xlPart,
SearchOrder:=xlByRows,
SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(0, -5).Select
ActiveCell.EntireRow.Delete
tutupfileall
Else
MsgBox "DATA BATAL DIHAPUS", vbOKOnly, "HAPUS DATA"
End If
End Sub

36

15.

Pada UserForm Masukkan perintah seperti di bawah ini :

Private Sub UserForm_INITIALIZE()
'MENGISI DATA PILIHAN COMBO BOX
cmbnama.AddItem "ALFAMART DC CILACAP"
cmbnama.AddItem "ALFAMART DC REMBANG"
cmbnama.AddItem "ALFAMART DC SMG"
cmbnama.AddItem "ALFAMART DC SOLO"
cmbnama.AddItem "INDOGROSIR SMG"
cmbnama.AddItem "INDOGROSIR YGY"
cmbnama.AddItem "INDOMARET DC SMG"
cmbnama.AddItem "INDOMARET DC YGY"
End Sub
Private Sub USERFORM_ACTIVATE()
LTANGGAL.Caption = Date
nomerkode
End Sub

16.

Buat prosedur dengan nama BORDER pada Module dengan tipe sub, untuk
memberi borderdan format di bawah data, masukkan perintah di bawah ini :

Public Sub nomerkode()
bukafileall
Range("G3").Select
Selection.End(xlDown).Select
nokode = ActiveCell.Value
Me.TextBox1.Value = nokode
Windows("PENGIRIMAN INVOICE ALL.xlsm").Activate
ActiveWindow.Close
Windows("PENGIRIMAN INVOICE KE BU TIM TIM.xlsm").Activate
End Sub

37

1. Faktur Penjualan

2. Bukti Penerimaan Barang (BPB)

38

3. Purchase Order (PO)

39

4. Delivery Order (DO)

40

5. Shipment Dokumen

41

6. Dokumen Load

42

7. Product Summary

43

8. Pick Slip

44

9. Laporan Pengiriman Invoice

45

10. Dokumen Daily Activity Monitoring

46

11. Dokumen Daily Report

47

Dokumen yang terkait

ANALISIS SISTEM PENGENDALIAN INTERN DALAM PROSES PEMBERIAN KREDIT USAHA RAKYAT (KUR) (StudiKasusPada PT. Bank Rakyat Indonesia Unit Oro-Oro Dowo Malang)

160 705 25

Analisis Sistem Pengendalian Mutu dan Perencanaan Penugasan Audit pada Kantor Akuntan Publik. (Suatu Studi Kasus pada Kantor Akuntan Publik Jamaludin, Aria, Sukimto dan Rekan)

136 695 18

ANALISIS PROSPEKTIF SEBAGAI ALAT PERENCANAAN LABA PADA PT MUSTIKA RATU Tbk

273 1263 22

Representasi Nasionalisme Melalui Karya Fotografi (Analisis Semiotik pada Buku "Ketika Indonesia Dipertanyakan")

53 338 50

KONSTRUKSI MEDIA TENTANG KETERLIBATAN POLITISI PARTAI DEMOKRAT ANAS URBANINGRUM PADA KASUS KORUPSI PROYEK PEMBANGUNAN KOMPLEK OLAHRAGA DI BUKIT HAMBALANG (Analisis Wacana Koran Harian Pagi Surya edisi 9-12, 16, 18 dan 23 Februari 2013 )

64 565 20

PEMAKNAAN BERITA PERKEMBANGAN KOMODITI BERJANGKA PADA PROGRAM ACARA KABAR PASAR DI TV ONE (Analisis Resepsi Pada Karyawan PT Victory International Futures Malang)

18 209 45

STRATEGI PUBLIC RELATIONS DALAM MENANGANI KELUHAN PELANGGAN SPEEDY ( Studi Pada Public Relations PT Telkom Madiun)

32 284 52

Berburu dengan anjing terlatih_1

0 46 1

DAMPAK INVESTASI ASET TEKNOLOGI INFORMASI TERHADAP INOVASI DENGAN LINGKUNGAN INDUSTRI SEBAGAI VARIABEL PEMODERASI (Studi Empiris pada perusahaan Manufaktur yang Terdaftar di Bursa Efek Indonesia (BEI) Tahun 2006-2012)

12 142 22

DISKRIMINATOR KELAYAKAN KREDIT MODAL KERJA BAGI UKM PADA PT BANK RAKYAT INDONESIA (PERSERO) TBK. CABANG LUMAJANG

5 61 16