This VBA code prints a range of pages from a report when a button is clicked. It gets the start and end page numbers from cells, checks that the range is valid, and then loops through printing each page, turning off screen updating for performance. If the page range is invalid it shows a critical message box.
This VBA code prints a range of pages from a report when a button is clicked. It gets the start and end page numbers from cells, checks that the range is valid, and then loops through printing each page, turning off screen updating for performance. If the page range is invalid it shows a critical message box.
This VBA code prints a range of pages from a report when a button is clicked. It gets the start and end page numbers from cells, checks that the range is valid, and then loops through printing each page, turning off screen updating for performance. If the page range is invalid it shows a critical message box.
Application.ScreenUpdating = False For i = Phon To Akhee With Sheets("RAPORT") .Range("p31").Value = i .PrintOut End With Next i Else MsgBox "Cek lagi Nomor yang akan dicetak...!!!!", vbCritical, "Cetak Halaman" End If End Sub