T0 Lampiran Institutional Repository | Satya Wacana Christian University: Pengecekan Tanggal Kadaluarsa Mesin Laboran untuk Kalibrasi dengan Menggunakan Makro

LAMPIRAN

Lampiran1 : Struktur Organisasi perusahaan

Lampiran2 : Struktur Organisasi Departmen Quality Assurance

Lampiran3 : Coding List
Form 1

‘untuk menambah data mesin
Private Sub CommandButton1_Click()
Dim lastkal
Dim bulan
Range("a10000").Select
ActiveCell.End(xlUp).Offset(1, 0).Select
ActiveCell.Value = "=ROW()-3"
ActiveCell.Value = "" & ActiveCell.Value
garis_Tabel
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TextBox1.Text
'nomesin

garis_Tabel
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TextBox2.Text
'namamesin
garis_Tabel
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TextBox3.Text
'kalibrasi
garis_Tabel
bulan = ActiveCell.AddressLocal
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TextBox4.Text
'lastkalibrasi
garis_Tabel
lastkal = ActiveCell.AddressLocal
ActiveCell.Offset(0, 1).Select
ActiveCell.FormulaArray = "=EDATE(" & lastkal & "," & bulan & ")"
garis_Tabel
CommandButton2_Click
End Sub

‘untuk menghapus data
Private Sub CommandButton2_Click()
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
End Sub
‘untukmelakukan pembatalan pengisian data mesin
Private Sub CommandButton3_Click()
Unload Me
End Sub
Private Sub TextBox4_Change()
End Sub
Private Sub TextBox4_Enter()
Calendar1.Visible = True
Calendar1.SetFocus
End Sub
Private Sub UserForm_Click()
End Sub


Form 2

Private Sub CommandButton1_Click()
Dim namamesin
Dim nomesin
Dim tglkal
Dim kalibrasi
Dim laNjut
Dim tglSblm
Dim selkiri
Dim selkanan
Sheets("DaftarMesin").Select
nomesin = TextBox1.Text
tglkal = CDate(TextBox2.Text)
Columns("B:B").Select
Cells.Find(what:=nomesin, after:=ActiveCell, LookIn:=xlValues, lookat:= _
xlPart, searchorder:=xlByColumns, searchdirection:=xlNext, MatchCase:=False,
searchformat:=False).Activate
ActiveCell.Offset(0, 1).Select

namamesin = ActiveCell.Value
MsgBox namamesin

ActiveCell.Offset(0, 1).Select
kalibrasi = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
tglSblm = ActiveCell.Value
ActiveCell.Value = tglkal
'memasukan data
Sheets("DaftarKalibrasi").Select
Range("B2").Select
ActiveCell.End(xlDown).Select
If (ActiveCell.Row >= 1048576) Then
Range("B3").Select
Else
ActiveCell.Offset(1, 0).Select
End If
selkiri = ActiveCell.AddressLocal
ActiveCell.Value = nomesin
ActiveCell.Offset(0, 1).Select

ActiveCell.Value = namamesin
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = kalibrasi
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = tglkal
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = tglSblm
selkanan = ActiveCell.AddressLocal
Range(selkiri & ":" & selkanan).Borders(xlEdgeBottom).LineStyle = xlcontinous
Range(selkiri & ":" & selkanan).Borders(xlEdgeBottom).ColorIndex = xlAutomatic
Range(selkiri & ":" & selkanan).Borders(xlEdgeBottom).TintAndShade = all
Range(selkiri & ":" & selkanan).Borders(xlEdgeBottom).Weight = xlMedium
Range(selkiri & ":" & selkanan).Borders(xlDiagonalDown).LineStyle = xlNone
Range(selkiri & ":" & selkanan).Borders(xlDiagonalUp).LineStyle = xlNone
Range(selkiri & ":" & selkanan).Borders(xlEdgeLeft).Weight = xlThin
Range(selkiri & ":" & selkanan).Borders(xlEdgeTop).Weight = xlThin
Range(selkiri & ":" & selkanan).Borders(xlEdgeRight).Weight = xlThin
Range(selkiri & ":" & selkanan).Borders(xlInsideVertical).Weight = xlThin
Range(selkiri & ":" & selkanan).Borders(xlInsideHorizontal).Weight = xlThin
End Sub


Module1

‘untuk memunculkan form 1 dan 2
Sub tambah()
'
' tambah Macro
'
'
UserForm1.Show
End Sub
Sub Pencatatan_Kalibrasi()
'
' Pencatatan_Kalibrasi Macro
'
'
UserForm2.Show
End Sub

Module2


Public Sub Check_tgl_Kalibrasi()
Call hapus_monitor
Call hapus_Layar
Dim noMes As String
Dim naMes
Dim kaL
Dim laSt
Dim laNjut
Dim selisiH
Dim blokKiri, blokKanan
Dim totalMesinYangHarusDikalibrasi As Integer
totalMesinYangHarusDikalibrasi = 0
Sheets("DaftarMesin").Select
Range("a4").Select
ActiveCell.Offset(1, 0).Select
Do Until IsEmpty(ActiveCell.Value)
ActiveCell.Offset(0, 1).Select
noMes = ActiveCell.Value
ActiveCell.Offset(0, 1).Select


naMes = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
kaL = Val(ActiveCell.Value)
ActiveCell.Offset(0, 1).Select
laSt = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
laNjut = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
selisiH = Val(ActiveCell.Value)
blokKanan = ActiveCell.AddressLocal
ActiveCell.Offset(0, -6).Select
blokKiri = ActiveCell.AddressLocal
'blok baris tersebut dengan warna nofill
Range(blokKiri & ":" & blokKanan).Select
With Selection.Interior
.Pattern = xlNone
'.PatternColorIndex = xlAutomatic
.TintAndShade = 0
.PatternTintAndShade = 0

End With
If (selisiH