Kamis, 22 Juni 2023

QR COde

 Function Buat_QR(codetext As String)

Dim URL As String, MyCell As Range

Set MyCell = Application.Caller

URL = "https://chart.googleapis.com/chart?chs=125x125&cht=qr&chl=" & codetext

On Error Resume Next

ActiveSheet.Pictures("MyQR_" & MyCell.Address(False, False)).Delete

On Error GoTo 0

ActiveSheet.Pictures.Insert(URL).Select

With Selection.ShapeRange(1)

.PictureFormat.CropLeft = 2

.PictureFormat.CropRight = 2

.PictureFormat.CropTop = 2

.PictureFormat.CropBottom = 2

.Name = "MyQR_" & MyCell.Address(False, False)

.Left = MyCell.Left + 25

.Top = MyCell.Top + 5

End With

Buat_QR = "" ' Masukkan text sebagai optional

End Function


Selasa, 20 Desember 2022

Print Raport MAM 1

'=======Cetak_Raport_MAM1=========
Sub cetak_banyak()
Dim mulai As Byte
Dim sampai As Byte
Dim a As Byte
mulai = Range("U3").Value
sampai = Range("V3").Value
For a = mulai To sampai
Range("M1") = a
Sheet44.PrintOut from:=1, To:=3, Copies:=1
Next a
Sheet44.Select
End Sub

Sabtu, 17 Desember 2022

Goal Sek - Analisa

 Sub goalsek()

'

' goalsek Macro

'


  Selection.GoalSeek Goal:=842, ChangingCell:=Selection.Offset(0, -1)






    

    

End Sub


Selasa, 13 Desember 2022

Bris Terakhir

Menuju Baris terakhir : 



Worksheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Value

nilainya berupa value dari cell tersebut

===========================

irow = Sheet1.Cells(Rows.Count, 1).End (xlUp).Offset(1, 0).row

nilainya berupa nomor baris 



Rabu, 08 Desember 2021

Pengaturan Cetak Dafnil, Dafdir, dan Raport


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


Menghitung USIA Excel

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