Modul Input SIA
Sub tmblInput_keJU()
Call KalkukalsiOff
'memanggil perintah inputBaris1 dan inputBaris2
Call inputBaris1
Call inputBaris2
With shInputJurnal
If .Cells(14, 2).Value <> "" Then
Call inputBaris3
Call inputBaris4
Call inputBaris5
ElseIf .Cells(13, 2).Value <> "" Then
Call inputBaris3
Call inputBaris4
ElseIf .Cells(12, 2).Value <> "" Then
Call inputBaris3
End If
End With
Call KalkulationOn
MsgBox "Input Jurnal Umum Berhasil", vbOKOnly
End Sub
'ketik Sub inputBaris1 lalu tekan Enter
Sub inputBaris1()
'membuat deklarasi di sheet Input Jurnal
Dim tanggal As Date
Dim noBukti, keterangan As String
Dim namaAkun, akunBantu As String
Dim debet, kredit As Integer
'membuat deklarasi di sheet Jurnal Umum
Dim barisAkhir, barisSelanjutnya As Integer
With shInputJurnal
tanggal = .Cells(5, 3).Value '(5,3) artinya baris ke-5 kolom ke-3
noBukti = .Cells(6, 3).Value
keterangan = .Cells(7, 3).Value
namaAkun = .Cells(10, 2).Value
akunBantu = .Cells(10, 3).Value
debet = .Cells(10, 4).Value
kredit = .Cells(10, 5).Value
End With
With shJU
'kode utk mengetahui baris terakhir yang kosong di sheet Jurnal Umum
barisAkhir = .Cells(.Rows.Count, 2).End(xlUp).Row
'mengisi baris di bawahnya dengan membuat sela satu baris
barisSelanjutnya = barisAkhir + 2
'mengisi kolom kolom di sheet Jurnal Umum
.Cells(barisSelanjutnya, 2) = tanggal
.Cells(barisSelanjutnya, 3) = noBukti
.Cells(barisSelanjutnya, 4) = keterangan
.Cells(barisSelanjutnya, 5) = namaAkun
.Cells(barisSelanjutnya, 7) = akunBantu
.Cells(barisSelanjutnya, 9) = debet
.Cells(barisSelanjutnya, 10) = kredit
End With
End Sub
Sub inputBaris2()
Dim tanggal As Date
Dim noBukti, keterangan As String
Dim namaAkun, akunBantu As String
Dim debet, kredit As String
Dim barisAkhir, barisSelanjutnya As Integer
With shInputJurnal
tanggal = .Cells(5, 3).Value
noBukti = .Cells(6, 3).Value
keterangan = .Cells(7, 3).Value
namaAkun = .Cells(11, 2).Value
akunBantu = .Cells(11, 3).Value
debet = .Cells(11, 4).Value
kredit = .Cells(11, 5).Value
End With
With shJU
barisAkhir = .Cells(.Rows.Count, 2).End(xlUp).Row
barisSelanjutnya = barisAkhir + 1
.Cells(barisSelanjutnya, 2) = tanggal
.Cells(barisSelanjutnya, 3) = noBukti
.Cells(barisSelanjutnya, 4) = keterangan
.Cells(barisSelanjutnya, 5) = namaAkun
.Cells(barisSelanjutnya, 9) = debet
.Cells(barisSelanjutnya, 10) = kredit
End With
End Sub
Sub inputBaris3()
Dim tanggal As Date
Dim noBukti, keterangan As String
Dim namaAkun, akunBantu As String
Dim debet, kredit As String
Dim barisAkhir, barisSelanjutnya As Integer
With shInputJurnal
tanggal = .Cells(5, 3).Value
noBukti = .Cells(6, 3).Value
keterangan = .Cells(7, 3).Value
namaAkun = .Cells(12, 2).Value
akunBantu = .Cells(12, 3).Value
debet = .Cells(12, 4).Value
kredit = .Cells(12, 5).Value
End With
With shJU
barisAkhir = .Cells(.Rows.Count, 2).End(xlUp).Row
barisSelanjutnya = barisAkhir + 1
.Cells(barisSelanjutnya, 2) = tanggal
.Cells(barisSelanjutnya, 3) = noBukti
.Cells(barisSelanjutnya, 4) = keterangan
.Cells(barisSelanjutnya, 5) = namaAkun
.Cells(barisSelanjutnya, 9) = debet
.Cells(barisSelanjutnya, 10) = kredit
End With
End Sub
Sub inputBaris4()
Dim tanggal As Date
Dim noBukti, keterangan As String
Dim namaAkun, akunBantu As String
Dim debet, kredit As String
Dim barisAkhir, barisSelanjutnya As Integer
With shInputJurnal
tanggal = .Cells(5, 3).Value
noBukti = .Cells(6, 3).Value
keterangan = .Cells(7, 3).Value
namaAkun = .Cells(13, 2).Value
akunBantu = .Cells(13, 3).Value
debet = .Cells(13, 4).Value
kredit = .Cells(13, 5).Value
End With
With shJU
barisAkhir = .Cells(.Rows.Count, 2).End(xlUp).Row
barisSelanjutnya = barisAkhir + 1
.Cells(barisSelanjutnya, 2) = tanggal
.Cells(barisSelanjutnya, 3) = noBukti
.Cells(barisSelanjutnya, 4) = keterangan
.Cells(barisSelanjutnya, 5) = namaAkun
.Cells(barisSelanjutnya, 9) = debet
.Cells(barisSelanjutnya, 10) = kredit
End With
End Sub
Sub inputBaris5()
Dim tanggal As Date
Dim noBukti, keterangan As String
Dim namaAkun, akunBantu As String
Dim debet, kredit As String
Dim barisAkhir, barisSelanjutnya As Integer
With shInputJurnal
tanggal = .Cells(5, 3).Value
noBukti = .Cells(6, 3).Value
keterangan = .Cells(7, 3).Value
namaAkun = .Cells(14, 2).Value
akunBantu = .Cells(14, 3).Value
debet = .Cells(14, 4).Value
kredit = .Cells(14, 5).Value
End With
With shJU
barisAkhir = .Cells(.Rows.Count, 2).End(xlUp).Row
barisSelanjutnya = barisAkhir + 1
.Cells(barisSelanjutnya, 2) = tanggal
.Cells(barisSelanjutnya, 3) = noBukti
.Cells(barisSelanjutnya, 4) = keterangan
.Cells(barisSelanjutnya, 5) = namaAkun
.Cells(barisSelanjutnya, 9) = debet
.Cells(barisSelanjutnya, 10) = kredit
End With
End Sub
Sub KalkukalsiOff()
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.EnableEvents = False
End Sub
Sub KalkulationOn()
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
Sub printPreview()
ActiveSheet.printPreview
End Sub
Sub hapusData()
Range("C5:C7").Value = ""
Range("B10:E14").Value = ""
End Sub
0 komentar :
Posting Komentar