15. Tombol Keluar (Exit)
Cara membuat dan mengaktifkan tombol exit yang terletak pada sheet (“Nilai Anda”) dan (“Penghargaan”) sama dengan tombol mengulang dan menyimpan. Klik Developer – Visual Basic – VBA Project Evaluasi Digital.xlsm– Insert Module 3. Masukkan script di bawah ke dalam Module 3.
Sub EXIT_Click()
MasukanData
Sheets("Nilai anda").Select
Sheets("S1").Select
Range("F21").Select
ActiveCell.FormulaR1C1 = ""
Range("F61").Select
ActiveCell.FormulaR1C1 = ""
Range("F101").Select
ActiveCell.FormulaR1C1 = ""
Range("F141").Select
ActiveCell.FormulaR1C1 = ""
Sheets("S2").Select
Range("F21").Select
ActiveCell.FormulaR1C1 = ""
Range("F61").Select
ActiveCell.FormulaR1C1 = ""
Range("F101").Select
ActiveCell.FormulaR1C1 = ""
Range("F141").Select
ActiveCell.FormulaR1C1 = ""
Sheets("S3").Select
Range("F21").Select
ActiveCell.FormulaR1C1 = ""
Range("F61").Select
ActiveCell.FormulaR1C1 = ""
Range("F101").Select
ActiveCell.FormulaR1C1 = ""
Range("F141").Select
ActiveCell.FormulaR1C1 = ""
Sheets("S4").Select
Range("F21").Select
ActiveCell.FormulaR1C1 = ""
Range("F61").Select
ActiveCell.FormulaR1C1 = ""
Range("F101").Select
ActiveCell.FormulaR1C1 = ""
Range("F141").Select
ActiveCell.FormulaR1C1 = ""
Sheets("S5").Select
Range("F21").Select
ActiveCell.FormulaR1C1 = ""
Range("F61").Select
ActiveCell.FormulaR1C1 = ""
Range("F101").Select
ActiveCell.FormulaR1C1 = ""
Range("F141").Select
ActiveCell.FormulaR1C1 = ""
Sheets("S6").Select
Range("F21").Select
ActiveCell.FormulaR1C1 = ""
Range("F61").Select
ActiveCell.FormulaR1C1 = ""
Range("F101").Select
ActiveCell.FormulaR1C1 = ""
Range("F141").Select
ActiveCell.FormulaR1C1 = ""
Sheets("S7").Select
Range("F21").Select
ActiveCell.FormulaR1C1 = ""
Range("F61").Select
ActiveCell.FormulaR1C1 = ""
Range("F101").Select
ActiveCell.FormulaR1C1 = ""
Range("F141").Select
ActiveCell.FormulaR1C1 = ""
Sheets("S8").Select
Range("F21").Select
ActiveCell.FormulaR1C1 = ""
Range("F61").Select
ActiveCell.FormulaR1C1 = ""
Range("F101").Select
ActiveCell.FormulaR1C1 = ""
Range("F141").Select
ActiveCell.FormulaR1C1 = ""
Sheets("S9").Select
Range("F21").Select
ActiveCell.FormulaR1C1 = ""
Range("F61").Select
ActiveCell.FormulaR1C1 = ""
Range("F101").Select
ActiveCell.FormulaR1C1 = ""
Range("F141").Select
ActiveCell.FormulaR1C1 = ""
Sheets("S10").Select
Range("F21").Select
ActiveCell.FormulaR1C1 = ""
Range("F61").Select
ActiveCell.FormulaR1C1 = ""
Range("F101").Select
ActiveCell.FormulaR1C1 = ""
Range("F141").Select
ActiveCell.FormulaR1C1 = ""
Sheets("S11").Select
Range("F21").Select
ActiveCell.FormulaR1C1 = ""
Range("F61").Select
ActiveCell.FormulaR1C1 = ""
Range("F101").Select
ActiveCell.FormulaR1C1 = ""
Range("F141").Select
ActiveCell.FormulaR1C1 = ""
Sheets("S12").Select
Range("F21").Select
ActiveCell.FormulaR1C1 = ""
Range("F61").Select
ActiveCell.FormulaR1C1 = ""
Range("F101").Select
ActiveCell.FormulaR1C1 = ""
Range("F141").Select
ActiveCell.FormulaR1C1 = ""
Sheets("S13").Select
Range("F21").Select
ActiveCell.FormulaR1C1 = ""
Range("F61").Select
ActiveCell.FormulaR1C1 = ""
Range("F101").Select
ActiveCell.FormulaR1C1 = ""
Range("F141").Select
ActiveCell.FormulaR1C1 = ""
Sheets("S14").Select
Range("F21").Select
ActiveCell.FormulaR1C1 = ""
Range("F61").Select
ActiveCell.FormulaR1C1 = ""
Range("F101").Select
ActiveCell.FormulaR1C1 = ""
Range("F141").Select
ActiveCell.FormulaR1C1 = ""
Sheets("S15").Select
Range("F21").Select
ActiveCell.FormulaR1C1 = ""
Range("F61").Select
ActiveCell.FormulaR1C1 = ""
Range("F101").Select
ActiveCell.FormulaR1C1 = ""
Range("F141").Select
ActiveCell.FormulaR1C1 = ""
Sheets("S16").Select
Range("F21").Select
ActiveCell.FormulaR1C1 = ""
Range("F61").Select
ActiveCell.FormulaR1C1 = ""
Range("F101").Select
ActiveCell.FormulaR1C1 = ""
Range("F141").Select
ActiveCell.FormulaR1C1 = ""
Sheets("S17").Select
Range("F21").Select
ActiveCell.FormulaR1C1 = ""
Range("F61").Select
ActiveCell.FormulaR1C1 = ""
Range("F101").Select
ActiveCell.FormulaR1C1 = ""
Range("F141").Select
ActiveCell.FormulaR1C1 = ""
Sheets("S18").Select
Range("F21").Select
ActiveCell.FormulaR1C1 = ""
Range("F61").Select
ActiveCell.FormulaR1C1 = ""
Range("F101").Select
ActiveCell.FormulaR1C1 = ""
Range("F141").Select
ActiveCell.FormulaR1C1 = ""
Sheets("S19").Select
Range("F21").Select
ActiveCell.FormulaR1C1 = ""
Range("F61").Select
ActiveCell.FormulaR1C1 = ""
Range("F101").Select
ActiveCell.FormulaR1C1 = ""
Range("F141").Select
ActiveCell.FormulaR1C1 = ""
Sheets("S20").Select
Range("F21").Select
ActiveCell.FormulaR1C1 = ""
Range("F61").Select
ActiveCell.FormulaR1C1 = ""
Range("F101").Select
ActiveCell.FormulaR1C1 = ""
Range("F141").Select
ActiveCell.FormulaR1C1 = ""
Sheets("FormImput").Select
Range("C2").Select
ActiveCell.FormulaR1C1 = ""
'close.workbook,save
ThisWorkbook.Save
ThisWorkbook.Close
End Sub
Sub Cetak()
ActiveSheet.Range("A1:L36").PrintOut
End Sub
Demikan script untuk mengaktifkan tombol EXIT, bagian selanjutnya adalah tentang cara menampilkan dan menyembunyikan lembar kerja secara bergantian (sheet). ........... NEXT