0% found this document useful (0 votes)
6 views4 pages

VBA Print Range Automation Code

Uploaded by

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

VBA Print Range Automation Code

Uploaded by

Rina Hasanah
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

NILAI

Private Sub CommandButton1_Click()

Dim Awal, Akhir As Integer

Awal = Range("P13").Value

Akhir = Range("P15").Value

If Awal <= Akhir And Awal >= 1 Then

[Link] = False

For i = Awal To Akhir

With Sheets("Cetak_Capaian1")

.Range("Q6").Value = i

.PrintOut

End With

Next i

Else

MsgBox "Cek lagi Nomor yang akan dicetak...!!!!", vbCritical, "Cetak Halaman"

End If

End Sub
BIODATA

Private Sub CommandButton1_Click()

Dim Awal, Akhir As Integer

Awal = Range("H11").Value

Akhir = Range("H12").Value

If Awal <= Akhir And Awal >= 1 Then

[Link] = False

For i = Awal To Akhir

With Sheets("Keterangan_Diri")

.Range("H1").Value = i

.PrintOut

End With

Next i

Else

MsgBox "Cek lagi Nomor yang akan dicetak...!!!!", vbCritical, "Cetak Halaman"

End If

End Sub
SAMPUL

Private Sub CommandButton1_Click()

Dim Awal, Akhir As Integer

Awal = Range("E5").Value

Akhir = Range("E6").Value

If Awal <= Akhir And Awal >= 1 Then

[Link] = False

For i = Awal To Akhir

With Sheets("Sampul1")

.Range("E8").Value = i

.PrintOut

End With

Next i

Else

MsgBox "Cek lagi Nomor yang akan dicetak...!!!!", vbCritical, "Cetak Halaman"

End If

End Sub

You might also like