Rabu, 08 Desember 2021

Pengaturan Cetak Dafnil, Dafdir, dan Raport


With Sheet1.PageSetup
.PaperSize = xlPaperLegal
.BottomMargin = Application.CentimetersToPoints(3)
End With


Jumat, 03 Desember 2021

Backup File

Private Sub Workbook_AfterSave(ByVal Success As Boolean)
Dim saveDate As Date
    Dim saveTime As Variant
    Dim formatTime As String
    Dim formatDate As String
    Dim backupFolder As String

    saveDate = Date
    saveTime = Time

    formatTime = Format(saveTime, "hh.MM.ss")
    formatDate = Format(saveDate, "DD MMM YYYY")

    Application.DisplayAlerts = False
        backupFolder = ThisWorkbook.Path & "\"
        ActiveWorkbook.SaveCopyAs Filename:=backupFolder & Replace("Backup-" & ActiveWorkbook.Name, ".xlsb", "") & " " & formatDate & " " & formatTime & ".xlsb"
    Application.DisplayAlerts = True

'    MsgBox "Backup Successfully In The Path " & backupFolder
End Sub

Menghitung USIA Excel

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