Rabu, 22 Mei 2024

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


Rabu, 12 Juli 2023

Selasa, 13 Juni 2023

Kamis, 13 Oktober 2022

Tulisan terbilang


 Dim Huruf(0 To 9) As String

Dim ax(0 To 3) As Double


Function INIT_angka()

    Huruf(0) = ""

    Huruf(1) = "satu "

    Huruf(2) = "dua "

    Huruf(3) = "tiga "

    Huruf(4) = "empat "

    Huruf(5) = "lima "

    Huruf(6) = "enam "

    Huruf(7) = "tujuh "

    Huruf(8) = "delapan "

    Huruf(9) = "sembilan "

    

End Function


Function dgratus(angka As Double) As String

    Temp = ""

    INIT_angka

    panjang = Len(Trim(Str(angka)))

    nilai = Right("000", 3 - panjang) + Trim(Str(angka))

    For y = 3 To 1 Step -1

        ax(y) = Mid(nilai, y, 1)

    Next y

    Select Case ax(1)

        Case Is = 1

          Temp = "seratus "

        Case Is > 1

          Temp = Huruf(Val(ax(1))) + "" + "ratus "

        Case Else

          Temp = ""

        End Select


    Select Case ax(2)

      Case Is = 0

          Temp = Temp + Huruf(Val(ax(3)))

      Case Is = 1

          Select Case ax(3)

            Case Is = 1

              Temp = Temp + "sebelas"

            Case Is = 0

              Temp = Temp + "sepuluh"

            Case Else

              Temp = Temp + Huruf(Val(ax(3))) + " belas"

          End Select

      Case Is > 1

          Temp = Temp + Huruf(Val(ax(2))) + "puluh"

          Temp = Temp + " " + Huruf(Val(ax(3)))

      End Select

    dgratus = Temp

End Function

Function pratama(angka As Double) As String

    Dim ratusan(0 To 6) As String

    Dim sebut(0 To 4) As String

    sebut(1) = " ribu "

    sebut(2) = " juta "

    sebut(3) = " milyar "

    sebut(4) = " trilyun "

    panjang = Len(Trim(Str(angka)))

    kali = Int(panjang / 3)

    If Int(panjang / 3) * 3 <> panjang Then

        kali = kali + 1

        sisa = panjang - Int(panjang / 3) * 3

        nilai = Right("000", 3 - sisa) + Trim(Str(angka))

    Else

        nilai = Trim(Str(angka))

    End If

    

    For x = 0 To kali

       ratusan(kali - x) = Mid(nilai, x * 3 + 1, 3)

    Next x

    

    For y = kali To 1 Step -1

        If y = 2 And Val(ratusan(y)) = 1 Then

            Temp = Temp + "seribu "

        Else

            If Val(ratusan(y)) = 0 Then

                Temp = Temp

            Else

                Temp = Temp + dgratus(Val(ratusan(y)))

                Temp = Temp + sebut(y - 1)

            End If

        End If

    Next y

    pratama = Temp & " rupiah"

End Function


Rabu, 30 Maret 2022

Kamis, 05 Agustus 2021

Selasa, 03 Agustus 2021