Sabtu, 30 Oktober 2021

Modul Cek Nilai


Sub hapusinduk()


Worksheets("isinilai").Unprotect "1"

    
        
    
'#########################################################


Dim barisakhir As Byte
Dim barisakhir5 As Byte
Dim baris As Byte
Dim kolomakhir As Byte

'===menghapus nilai ke bawah yang tidak ada nama siswanya======

barisakhir = Worksheets("isinilai").Range("G5").Value + 8
Cells(barisakhir, 12).Select
Range(Selection, "AJ57").Select
Selection.ClearContents

'=====menghapus nilai ke samping yang tidak ada mapelnya=====
kolomakhir = Worksheets("isinilai").Range("I1").Value + 12
Cells(8, kolomakhir).Select
Range(Selection, "AJ57").Select
Selection.ClearContents

''==========menghapus induk yang kosong =============
barisakhir5 = Range("G5").Value + 7

For baris = 8 To barisakhir5
    If Range("H" & baris).Value = 0 Then
            For kolom = 12 To 36
        Cells(baris, kolom).ClearContents
        Next kolom
    End If
    Next baris

 Worksheets("isinilai").Protect "1", userinterfaceonly:=True
    
End Sub


Tidak ada komentar:

Posting Komentar

Menghitung USIA Excel

=BYROW(D2:D100; LAMBDA(tanggal_lahir;     IF(tanggal_lahir=""; "";         DATEDIF(tanggal_lahir; TODAY(); "y"...