Tampilkan postingan dengan label Selection. Tampilkan semua postingan
Tampilkan postingan dengan label Selection. Tampilkan semua postingan

Senin, 25 Oktober 2021

Used Range


Sub test()


ActiveSheet.UsedRange.Select


End Sub

Ngeblok sejumlah Baris dan Kolom Akhir



Sub test()


Dim barisakhir As Long
Dim kolomakhir As Long

barisakhir = Cells.Find(what:="*", searchdirection:=xlPrevious, searchorder:=xlByRows).Row

kolomakhir = Cells.Find(what:="*", searchdirection:=xlPrevious, searchorder:=xlByColumns).Column

Range("C3").Resize(barisakhir, kolomakhir).Select

End Sub
  

Seleksi dengan Resize

Sub test() Range("C3").Resize(4, 3).Select 'jika resize ngeblok sesaui dengan jumlah kolom dan baris dg C3 sebagai acuan End Sub

Seleksi Dengan Offset

Sub test() Range(ActiveCell, ActiveCell.Offset(5, 2)).Select 'kalau offset dimulai dari nol End Sub

Seleksi Beberapa Cell Sekaligus

Sub test() Range("A3, D5, F1:F4").Select End Sub

Current Region


sub test()

ActiveCell.CurrentRegion.Select


'catatan : datanya harus nempel/nyambung, sehingga bisa diseleksi, salah satu cell harus aktif di data tersebut
End Sub

Seleksi Baris Akhir

Sub test() barisakhir = Cells(Rows.Count, 2).End(xlUp).Row Range(Cells(2, 2), Cells(barisakhir, 2)).Select End Sub

Menghitung USIA Excel

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