LAMPIRAN
Lampiran 3 : Coding List
Form 1
Private Sub Calendar1_AfterUpdate() TextBox4.Text = Calendar1.Value End Sub
Private Sub Calendar1_Exit(ByVal Cancel As MSForms.ReturnBoolean) TextBox4.Text = Calendar1.Value 'tanggalkalibrasi
TextBox5.Text = DateAdd("yyyy", CInt(TextBox6.Text), Calendar1.Value) 'menghitung berapa bulan setelah tgal kalibrasi
End Sub
Private Sub CommandButton1_Click() Dim selKiri
Dim selKanan
'memasukan data per sheet dan memilih sheet Dim namasheet
namasheet = Me.ComboBox1.Value Sheets(namasheet).Select 'input data
Range("a10000").Select
ActiveCell.End(xlUp).Offset(1, 0).Select ActiveCell.Value = "=ROW()-1"
selKiri = ActiveCell.AddressLocal
ActiveCell.Value = " " & ActiveCell.Value ActiveCell.Offset(0, 1).Value = TextBox1.Text ActiveCell.Offset(0, 2).Value = ComboBox1.Text ActiveCell.Offset(0, 3).Value = TextBox2.Text ActiveCell.Offset(0, 4).Value = TextBox3.Text ActiveCell.Offset(0, 5).Value = TextBox6.Text ActiveCell.Offset(0, 6).Value = TextBox4.Text ActiveCell.Offset(0, 7).Value = TextBox5.Text Dim pcell
pcell = ActiveCell.Row
ActiveCell.Offset(0, 8).FormulaArray = "=h" & pcell & "-now()" ActiveCell.Offset(0, 8).Select
'membuat border
selKanan = ActiveCell.AddressLocal Range(selKiri & ":" & selKanan).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
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
CommandButton2_Click ' Membersihkan textbox setelah diinput. End Sub
Private Sub CommandButton2_Click() TextBox1.Text = ""
ComboBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" TextBox5.Text = "" TextBox6.Text = "" End Sub
Private Sub CommandButton3_Click() Unload Me
End Sub
Private Sub UserForm_Initialize()
Form 2
Private Sub CommandButton1_Click() 'Sheets.Add after:=ActiveSheet 'aktivesheet.Name = TextBox1.Value Dim kodedok
Dim jenisdok Dim akhir
Dim rangeku As Range Dim dokumenku As Workbook kodedok = TextBox1.Value jenisdok = TextBox2.Value Sheets("Jenis Dokumen").Select 'Range("a10000").Select Range("a1").Select
ActiveCell.End(xlDown).Select ActiveCell.Offset(1, 0).Select
'ActiveCell.Value = " " & ActiveCell.Value ActiveCell.Value = kodedok
ActiveCell.Offset(0, 1).Select ActiveCell.Value = jenisdok akhir = ActiveCell.AddressLocal
ActiveWorkbook.Names.Add Name:="jenisDokumen", RefersTo:="='Jenis Dokumen'!$a$2:" & akhir
ActiveWorkbook.Sheets.Add(after:=ActiveWorkbook.Sheets(ActiveWorkbook.Sheets.Count)).N ame = kodedok
Call JDL ' memanggil judul otomatis End Sub
Private Sub CommandButton2_Click() TextBox1.Text = ""
TextBox2.Text = "" End Sub
Private Sub CommandButton3_Click() Unload Me
Form 3
Private Sub Calendar1_AfterUpdate() TextBox5.Text = Calendar1.Value End Sub
Private Sub Calendar1_Exit(ByVal Cancel As MSForms.ReturnBoolean) TextBox5.Text = Calendar1.Value 'tanggal dikeluarkan
TextBox6.Text = DateAdd("yyyy", CInt(TextBox4.Text), Calendar1.Value) 'menghitung berapa tahun setelah tgal dikeluarkan
End Sub
Private Sub CommandButton1_Click() Dim namaDok
Dim selKanan, selKiri
'memasukan data per sheet dan memilih sheet Dim namasheet
namasheet = Me.ComboBox1.Value Sheets(namasheet).Select noDok = TextBox1.Text namaDok = TextBox2.Text lembaga = TextBox3.Text masa = TextBox8.Text noDokBaru = TextBox7.Text term = TextBox4.Text tglBaru = TextBox5.Text masaBaru = TextBox6.Text
Columns("E:E").Select ' mencari no dokumen
Cells.Find(what:=noDok, after:=ActiveCell, LookIn:=xlValues, lookat:=xlPart,
searchorder:=xlByColumns, searchdirection:=xlNext, MatchCase:=False,
searchformat:=False).Activate
ActiveCell.Offset(0, -3).Select 'kolom B namaDok = ActiveCell.Value
TextBox2.Text = namaDok
ActiveCell.Offset(0, 2).Select ' kolom D lembaga = ActiveCell.Value
TextBox3.Text = lembaga
ActiveCell.Offset(0, 3).Select ' kolom H masa = ActiveCell.Value
TextBox8.Text = masa End Sub
Private Sub CommandButton2_Click() 'menginputkan data
ActiveCell.Offset(0, (ActiveCell.Column - 1) * -1).Select ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TextBox2.Text ' nama dok ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TextBox3.Text ' lembaga ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TextBox7.Text ' no ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TextBox4.Text ' term ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TextBox5.Text ' tgl diperbarui ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TextBox6.Text ' masa
ActiveCell.Offset(0, 2).Value = ComboBox2.Text ' status ActiveCell.Offset(0, 1).Select
selKanan = ActiveCell.AddressLocal
ActiveCell.Offset(0, (ActiveCell.Column - 1) * -1).Select selKiri = ActiveCell.AddressLocal
CommandButton3_Click
Range(selKiri & ":" & selKanan).Select With Selection.Interior
Private Sub CommandButton3_Click() TextBox1.Text = ""
TextBox2.Text = "" ComboBox1.Text = "" TextBox3.Text = "" TextBox4.Text = "" TextBox5.Text = "" TextBox6.Text = "" TextBox7.Text = "" TextBox8.Text = "" ComboBox2.Text = "" End Sub
Private Sub CommandButton4_Click() Unload Me
End Sub
Private Sub UserForm_Initialize()
Form 4
Private Sub Calendar1_AfterUpdate() TextBox5.Text = Calendar1.Value End Sub
Private Sub Calendar1_Exit(ByVal Cancel As MSForms.ReturnBoolean) TextBox5.Text = Calendar1.Value 'tanggal dikeluarkan
TextBox6.Text = DateAdd("yyyy", CInt(TextBox4.Text), Calendar1.Value) 'menghitung berapa tahun setelah tgal dikeluarkan
End Sub
Private Sub CommandButton1_Click() Dim namaDok
'memasukan data per sheet dan memilih sheet Dim namasheet
namasheet = Me.ComboBox1.Value Sheets(namasheet).Select noDok = TextBox1.Text namaDok = TextBox8.Text lembaga = TextBox3.Text term = TextBox4.Text tglKeluar = TextBox5.Text masa = TextBox6.Text Columns("E:E").Select
Cells.Find(what:=noDok, after:=ActiveCell, LookIn:=xlValues, lookat:=xlPart,
searchorder:=xlByColumns, searchdirection:=xlNext, MatchCase:=False,
searchformat:=False).Activate
ActiveCell.Offset(0, -3).Select 'kolom B namaDok = ActiveCell.Value
TextBox8.Text = namaDok
ActiveCell.Offset(0, 1).Select ' kolom C lembaga = ActiveCell.Value
TextBox3.Text = lembaga
ActiveCell.Offset(0, 3).Select ' kolom F term = ActiveCell.Value
TextBox4.Text = term
ActiveCell.Offset(0, 1).Select ' kolom G tglKeluar = ActiveCell.Value
TextBox5.Text = tglKeluar
ActiveCell.Offset(0, 1).Select ' kolom H masa = ActiveCell.Value
TextBox6.Text = masa End Sub
Private Sub CommandButton2_Click() 'namaDok = ActiveCell.Value
ActiveCell.Value = TextBox8.Text ' nama dok ActiveCell.Offset(0, 1).Select
ActiveCell.Value = ComboBox1.Text ' jenis dok ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TextBox3.Text ' lembaga ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TextBox1.Text ' no ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TextBox4.Text ' term ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TextBox5.Text ' tgl keluar
ActiveCell.Offset(0, 1).Value = TextBox6.Text ' masa
End Sub
Private Sub CommandButton4_Click() Unload Me
End Sub
Private Sub UserForm_Initialize()
Modul 1
Public Sub format() Range("a1").Value = "NO"
Range("b1").Value = "Nama Dokumen" Range("c1").Value = "Jenis Dokumen" Range("d1").Value = "Lembaga Sertifikasi" Range("e1").Value = "Nomor Dokumen" Range("f1").Value = "Tanggal Dikeluarkan" Range("g1").Value = "Masa Berlaku" End Sub
Dim totalMasaTG As Integer totalMasaTG = 0
Dim selKiri, selKanan Dim tabelJenis() As Variant Dim daftarSheet() As Variant tabelJenis = Range("jenisDokumen") Dim r As Long
ReDim daftarSheet(UBound(tabelJenis, 1)) For r = 1 To UBound(tabelJenis, 1) 'daftarSheet(r) = tabelJenis(r, 1) Sheets(tabelJenis(r, 1)).Select Range("A2").Select
namDok = ActiveCell.Value ActiveCell.Offset(0, 1).Select jenDok = ActiveCell.Value ActiveCell.Offset(0, 1).Select lembaga = ActiveCell.Value ActiveCell.Offset(0, 1).Select noDok = ActiveCell.Value ActiveCell.Offset(0, 1).Select term = ActiveCell.Value ActiveCell.Offset(0, 1).Select tglKeluar = ActiveCell.Value ActiveCell.Offset(0, 1).Select masa = ActiveCell.Value ActiveCell.Offset(0, 1).Select selisih = ActiveCell.Value
selKanan = ActiveCell.AddressLocal ActiveCell.Offset(0, -8).Select selKiri = ActiveCell.AddressLocal If (selisih <= 96 And selisih > 0) Then Range(selKiri & ":" & selKanan).Select With Selection.Interior
.Pattern = xlSolid ActiveCell.Value = "=ROW()-2"
ActiveCell.Value = " " & ActiveCell.Value ActiveCell.Offset(0, 1).Select
ActiveCell.Value = namDok ActiveCell.Offset(0, 1).Select ActiveCell.Value = jenDok ActiveCell.Offset(0, 1).Select ActiveCell.Value = lembaga ActiveCell.Offset(0, 1).Select ActiveCell.Value = noDok ActiveCell.Offset(0, 1).Select ActiveCell.Value = term ActiveCell.Offset(0, 1).Select ActiveCell.Value = tglKeluar ActiveCell.Offset(0, 1).Select ActiveCell.Value = masa totalMasaTG = totalMasaTG + 1 End If
Sheets(tabelJenis(r, 1)).Select ActiveCell.Offset(1, 0).Select Loop
Next r
MsgBox ("Total Sertifikat Yang Masuk Masa Tenggang adalah " & totalMasaTG & " Segera Perbarui")
Modul 7
Dim totalExp As Integer totalExp = 0
Dim selKiri, selKanan Dim tabelJenis() As Variant Dim daftarSheet() As Variant tabelJenis = Range("jenisDokumen") Dim r As Long
ReDim daftarSheet(UBound(tabelJenis, 1)) For r = 1 To UBound(tabelJenis, 1) 'daftarSheet(r) = tabelJenis(r, 1) Sheets(tabelJenis(r, 1)).Select Range("A2").Select
ActiveCell.Offset(1, 0).Select Do Until IsEmpty(ActiveCell.Value) ActiveCell.Offset(0, 1).Select namDok = ActiveCell.Value ActiveCell.Offset(0, 1).Select jenDok = ActiveCell.Value ActiveCell.Offset(0, 1).Select lembaga = ActiveCell.Value ActiveCell.Offset(0, 1).Select noDok = ActiveCell.Value ActiveCell.Offset(0, 1).Select term = ActiveCell.Value ActiveCell.Offset(0, 1).Select tglKeluar = ActiveCell.Value ActiveCell.Offset(0, 1).Select masa = ActiveCell.Value ActiveCell.Offset(0, 1).Select selisih = ActiveCell.Value
selKanan = ActiveCell.AddressLocal ActiveCell.Offset(0, -8).Select selKiri = ActiveCell.AddressLocal
If (selisih < 1) Then
ActiveCell.Value = " " & ActiveCell.Value ActiveCell.Offset(0, 1).Select
ActiveCell.Value = namDok ActiveCell.Offset(0, 1).Select ActiveCell.Value = jenDok ActiveCell.Offset(0, 1).Select ActiveCell.Value = lembaga ActiveCell.Offset(0, 1).Select ActiveCell.Value = noDok ActiveCell.Offset(0, 1).Select ActiveCell.Value = term ActiveCell.Offset(0, 1).Select ActiveCell.Value = tglKeluar ActiveCell.Offset(0, 1).Select ActiveCell.Value = masa totalExp = totalExp + 1
MsgBox ("Total Sertifikat Expired adalah " & totalExp) End Sub
'formatMonitor Macro
'hapus isi monitor Sheets("Monitor1").Select Range("A1:h60000").Select
Selection.Delete Shift:=xlToLeft 'beri judul
ActiveCell.FormulaR1C1 = "Monitor 1" Range("A2").Select
ActiveCell.FormulaR1C1 = "No" Range("B2").Select
ActiveCell.FormulaR1C1 = "Nama Dokumen" Range("C2").Select
ActiveCell.FormulaR1C1 = "Lembaga Sertifikasi" Range("D2").Select
ActiveCell.FormulaR1C1 = "Jenis Dokumen" Range("E2").Select
ActiveCell.FormulaR1C1 = "Nomor Dokumen" Range("F2").Select
Range("G2").Select
ActiveCell.FormulaR1C1 = "Tanggal Dikeluarkan" Range("H2").Select
ActiveCell.FormulaR1C1 = "Masa Berlaku" Range("A1").Select
Range("A2:I2").Select With Selection.Font
.ThemeColor = xlThemeColorDark1 .TintAndShade = 0
End With
With Selection.Interior .Pattern = xlSolid
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
.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
Cells.EntireColumn.AutoFit Range("A2").Select
Columns("A:A").ColumnWidth = 4.29 Range("I2").Select
With Selection.Interior .Pattern = xlNone .TintAndShade = 0
.PatternTintAndShade = 0 End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone Selection.Borders(xlEdgeLeft).LineStyle = xlNone Selection.Borders(xlEdgeTop).LineStyle = xlNone Selection.Borders(xlEdgeBottom).LineStyle = xlNone Selection.Borders(xlEdgeRight).LineStyle = xlNone Selection.Borders(xlInsideVertical).LineStyle = xlNone Selection.Borders(xlInsideHorizontal).LineStyle = xlNone Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous .ColorIndex = 0
.TintAndShade = 0 .Weight = xlThin End With
Selection.Borders(xlEdgeTop).LineStyle = xlNone Selection.Borders(xlEdgeBottom).LineStyle = xlNone Selection.Borders(xlEdgeRight).LineStyle = xlNone Selection.Borders(xlInsideVertical).LineStyle = xlNone Selection.Borders(xlInsideHorizontal).LineStyle = xlNone Range("A2:H2").Select
With Selection.Interior .Pattern = xlSolid
Sub formatMonitor2() 'hapus isi monitor Sheets("Monitor2").Select Range("A1:h60000").Select
'beri judul
ActiveCell.FormulaR1C1 = "Monitor 2" Range("A2").Select
ActiveCell.FormulaR1C1 = "No" Range("B2").Select
ActiveCell.FormulaR1C1 = "Nama Dokumen" Range("C2").Select
ActiveCell.FormulaR1C1 = "Lembaga Sertifikasi" Range("D2").Select
ActiveCell.FormulaR1C1 = "Jenis Dokumen" Range("E2").Select
ActiveCell.FormulaR1C1 = "Nomor Dokumen" Range("F2").Select
ActiveCell.FormulaR1C1 = "Term (Tahun)" Range("G2").Select
ActiveCell.FormulaR1C1 = "Tanggal Dikeluarkan" Range("H2").Select
ActiveCell.FormulaR1C1 = "Masa Berlaku" Range("A1").Select
Range("A2:I2").Select With Selection.Font
.ThemeColor = xlThemeColorDark1 .TintAndShade = 0
End With
With Selection.Interior .Pattern = xlSolid
Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft)
.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
Cells.EntireColumn.AutoFit Range("A2").Select
Columns("A:A").ColumnWidth = 4.29 Range("I2").Select
With Selection.Interior .Pattern = xlNone .TintAndShade = 0
.PatternTintAndShade = 0 End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone Selection.Borders(xlEdgeLeft).LineStyle = xlNone Selection.Borders(xlEdgeTop).LineStyle = xlNone Selection.Borders(xlEdgeBottom).LineStyle = xlNone Selection.Borders(xlEdgeRight).LineStyle = xlNone Selection.Borders(xlInsideVertical).LineStyle = xlNone Selection.Borders(xlInsideHorizontal).LineStyle = xlNone Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous .ColorIndex = 0
.TintAndShade = 0 .Weight = xlThin End With
Selection.Borders(xlEdgeTop).LineStyle = xlNone Selection.Borders(xlEdgeBottom).LineStyle = xlNone Selection.Borders(xlEdgeRight).LineStyle = xlNone Selection.Borders(xlInsideVertical).LineStyle = xlNone Selection.Borders(xlInsideHorizontal).LineStyle = xlNone Range("A2:H2").Select
.PatternColorIndex = xlAutomatic
ActiveCell.FormulaR1C1 = "No" Range("B1").Select
ActiveCell.FormulaR1C1 = "Nama Dokumen" Range("C1").Select
ActiveCell.FormulaR1C1 = "Jenis Dokumen" Range("D1").Select
ActiveCell.FormulaR1C1 = "Lembaga Sertifikasi" Range("E1").Select
ActiveCell.FormulaR1C1 = "Nomor Dokumen" Range("F1").Select
ActiveCell.FormulaR1C1 = "Term (Tahun)" Range("E1:G3").Select
Range("G1").Activate
ActiveCell.FormulaR1C1 = "Tanggal Dikeluarkan" Range("H1").Select
ActiveCell.FormulaR1C1 = "Masa Berlaku" Range("I1").Select
ActiveCell.FormulaR1C1 = "Sisa Waktu (Hari)" Range("A1:I1").Select
With Selection.Font
.ThemeColor = xlThemeColorDark1 .TintAndShade = 0
End With
With Selection.Interior .Pattern = xlSolid
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
.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 Cells.Select
Cells.EntireColumn.AutoFit Range("A2").Select