0% found this document useful (0 votes)
81 views

Coding Modul: 1. Modul Scrool Dan Protect Sheet

This document contains 3 coding modules: 1. The first module contains macros for scrolling and protecting a sheet, and for automatically numbering students and teachers. 2. The second module contains macros for opening different forms and for saving and exiting the workbook. 3. The third module contains macros for sorting student and teacher data in ascending order.

Uploaded by

D'setiawan
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)
81 views

Coding Modul: 1. Modul Scrool Dan Protect Sheet

This document contains 3 coding modules: 1. The first module contains macros for scrolling and protecting a sheet, and for automatically numbering students and teachers. 2. The second module contains macros for opening different forms and for saving and exiting the workbook. 3. The third module contains macros for sorting student and teacher data in ascending order.

Uploaded by

D'setiawan
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
You are on page 1/ 2

CODING MODUL

1. MODUL SCROOL DAN PROTECT SHEET

Private Sub Workbook_Open()


Sheets("MENU").ScrollArea = "A1:U33"
End Sub
Sub ProtectSheet()
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub

Sub UnprotectSheet()
ActiveSheet.Unprotect
End Sub

Sub AutoNumberSiswa()
Application.ScreenUpdating = False
Sheet3.Select
Dim i As Long
i = Application.WorksheetFunction.CountA(Sheet3.Range("B5:B100000")) + 4
Sheet3.Range("A5").Value = 1
Sheet3.Range("A6").Value = 2
Sheet3.Range("A5:A6").Select
Selection.AutoFill Destination:=Range("A5:A" & i), Type:=xlFillDefault
Sheet3.Range("A4").Select
Sheet1.Select
End Sub

Sub AutoNumberGuru()
Application.ScreenUpdating = False
Sheet2.Select
Dim i As Long
i = Application.WorksheetFunction.CountA(Sheet2.Range("B5:B10000")) + 4
Sheet2.Range("A5").Value = 1
Sheet2.Range("A6").Value = 2
Sheet2.Range("A5:A6").Select
Selection.AutoFill Destination:=Sheet2.Range("A5:A" & i), Type:=xlFillDefault
Sheet2.Range("A4").Select
Sheet1.Select
End Sub
2. MODUL TOMBOL NAVIGASI
Sub BukaFormGuru()
FORMTABELGURU.Show
End Sub
Sub BukaFormSiswa()
FORMTABELSISWA.Show
End Sub

Sub BukaFormCari()
FORMCARI.Show
End Sub
Sub Simpan()
ThisWorkbook.Save
End Sub
Sub Keluar()
Select Case MsgBox("Anda akan keluar dari Aplikasi" _
& vbCrLf & "Apakah anda yakin?" _
, vbYesNo Or vbQuestion Or vbDefaultButton1, "Keluar")
Case vbNo
Exit Sub
Case vbYes
End Select
ThisWorkbook.Save
ThisWorkbook.Close
End Sub

3. MODUL URUT
Sub UrutGuru()
Application.ScreenUpdating = False
Sheet2.Select
Sheet2.Range("A4:J20000").Sort KEY1:=Range("B4"), Order1:=xlAscending, Header:=xlYes
Sheet1.Select
End Sub
Sub UrutSiswa()
Application.ScreenUpdating = False
Sheet3.Select
Sheet3.Range("A4:L20000").Sort KEY1:=Range("C4"), Order1:=xlAscending, Header:=xlYes
Sheet1.Select
End Sub

You might also like