Kumpulan Kode VBA Dasar
dan Berikut Kode VBA untuk latihan Anda silakan dicoba
Sub VBAExcelidDOTcom()
Dim Terbesar As Integer
Dim baris As Integer
Dim kolom As Integer
Range("A1").Select
ActiveCell.FormulaR1C1 = "1"
Range("B1").Select
ActiveCell.FormulaR1C1 = "2"
Range("A1:B1").Select
Selection.AutoFill Destination:=Range("A1:H1"), Type:=xlFillDefault
Range("A1:H1").Select
Range("A2").Select
ActiveCell.FormulaR1C1 = "3"
Range("A1:A2").Select
Selection.AutoFill Destination:=Range("A1:A20"), Type:=xlFillDefault
Range("A1:A20").Select
Range("B2").Select
ActiveCell.FormulaR1C1 = "=R1C*RC1"
Range("B2").Select
Selection.AutoFill Destination:=Range("B2:H2"), Type:=xlFillDefault
Range("B2:H2").Select
Selection.AutoFill Destination:=Range("B2:H20"), Type:=xlFillDefault
Range("B2:H20").Select
Range("E11").Select
ActiveCell.FormulaR1C1 = "1000"
Range("A1").Select
' The code from here finds and selects the cell
Range("A1:H20").Select
Terbesar = -32768
ActiveCell.SpecialCells(xlLastCell).Select
For intRow = 1 To ActiveCell.Row
For intCol = 1 To ActiveCell.Column
If Cells(intRow, intCol).Value > Terbesar Then
Terbesar = Cells(intRow, intCol).Value
baris = intRow
kolom = intCol
End If
Next
Next
Cells(baris, kolom).Select
End Sub
Udah dicoba? bagaima hasilnya? silakan tuliskan dikomentar jika ada pertanyaan Insya Allah jika saya mampu menjawab akan saya balas.
tabel perkalian
BalasHapus