0% found this document useful (0 votes)
135 views1 page

Macro Slip Gaji

The document contains code for macros that control numbering and printing. The Awal macro sets the initial number to 1. Akhir sets the number to the value in cell N2. Berikutnya increments the number if it is less than the value in N2. Sebelumnya decrements the number if it is greater than 1. Lihat and Cetak show the print preview and print dialogs. CetakSemua prints the sheet from 1 to the value in N2, incrementing the number after each print using Berikutnya.

Uploaded by

Nophied
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
135 views1 page

Macro Slip Gaji

The document contains code for macros that control numbering and printing. The Awal macro sets the initial number to 1. Akhir sets the number to the value in cell N2. Berikutnya increments the number if it is less than the value in N2. Sebelumnya decrements the number if it is greater than 1. Lihat and Cetak show the print preview and print dialogs. CetakSemua prints the sheet from 1 to the value in N2, incrementing the number after each print using Berikutnya.

Uploaded by

Nophied
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Sub Awal()

Range("N1").Value = 1
End Sub

Sub Akhir()
Dim Karyawan As Integer
Karyawan = Range("N2").Value
Range("N1").Value = Karyawan
End Sub

Sub Berikutnya()
Dim Nomor, Karyawan As Integer
Nomor = Range("N1").Value
Karyawan = Range("N2").Value
If Nomor < Karyawan Then
Nomor = Nomor + 1
End If
Range("N1").Value = Nomor
End Sub

Sub Sebelumnya()
Dim Nomor As Integer
Nomor = Range("N1").Value
If Nomor > 1 Then
Nomor = Nomor - 1
End If
Range("N1").Value = Nomor
End Sub

Sub Lihat()
Application.Dialogs(xlDialogPrintPreview).Show
End Sub

Sub Cetak()
Application.Dialogs(xlDialogPrint).Show
End Sub

Sub CetakSemua()
Dim Karyawan, i As Integer
Karyawan = Range("N2").Value
Awal
For i = 1 To Karyawan
ActiveSheet.PrintOut
Berikutnya
Next
End Sub

You might also like