Materi Perkuliahan

Membuat Media dasar bilangan prima VBA Excel

Private Sub CommandButton1_Click() Dim a As Integer Dim b As Integer Dim c As Integer Dim i As Integer Dim j As Integer Dim k As Integer a = Range(“C3”) b = Range(“E3”) If a <= 2 Then Range(“A4”) = “1” Range(“C5”) = “2” Else If a > 2 Then
baca selengkapnya…

Media bilangan Asli berurutan dengan VBA Excel

Private Sub CommandButton1_Click() Dim x As Integer Range(“C2”) = ten(5) End Sub Function ben(x) Dim ans, i As Integer ans = 0 For i = 1 To x ans = ans + i Next i ben = ans End Function Function ten(x) Dim ans, i As Integer ans = 0
baca selengkapnya…

Media Animasi Memindahkan Ikan dengan VBA Excel

Membuat Kode untuk membuat animasi gambar VBA for Excel Membuat bilangan asli dengan memasukan jumlah ikan Sub masukan() Dim lembar As Worksheet Set lembar = Worksheets(1) Range(“A1”) = Range(“A1”) + 1 lembar.Shapes(“ikan”).Duplicate.Name = “ikan” & Range(“A1”) lembar.Shapes(“ikan” & Range(“A1”)).Left = Cells(2, 2 + Range(“A1”)).Left lembar.Shapes(“ikan” & Range(“A1”)).Top = Cells(2, 2
baca selengkapnya…

Aplikasi media matematika dengan waktu menggunakan VBA for Excel

The procedures to be entered in a Standard Module:   Public¬†dTime As Date ______________________ Sub SetReminder() ‘This Application.OnTime procedure sets reminders at specific times and auto-closes workbook at a specified time: On Error Resume Next dTime = Now + TimeValue(“00:00:01”) ‘procedure named SetReminder will autmatically run, at the sheduled time
baca selengkapnya…

Media waktu bagian 3

Example 1: This procedure uses the OnTime Method to auto increment cell value at specific time intervals, and Stops the procedure on crossing a specific cell value. The procedure should be entered in a Standard Module (select Insert>Module, in VBE code window).   ‘Dim as a Public variable and it
baca selengkapnya…

Media Waktu bagian 2

Example 1: This procedure uses the OnTime Method to auto increment cell value at specific time intervals, and Stops the procedure on crossing a specific cell value. The procedure should be entered in a Standard Module (select Insert>Module, in VBE code window).   ‘Dim as a Public variable and it
baca selengkapnya…

Media waktu menggunakan VBA excel

Example 2: This procedure uses the OnTime Method to auto increment cell value at specific time intervals, and Stops the procedure after it runs for a specific number of times. The procedure should be entered in a Standard Module (select Insert>Module, in VBE code window).   Public eTime As Date
baca selengkapnya…

Memutarkan Objek dengan Menggunakan VBA Excel

Sub trigonometri() Dim lembar As Worksheet Set lembar = Worksheets(5) a = 4 * Application.WorksheetFunction.Atan2(1, 1) Range(“B1”).Formula = Tan(a * Range(“A1”) / 180) lembar.Shapes(“segitiga”).Height = Range(“C1”) * Sin(a * Range(“A1”) / 180) lembar.Shapes(“segitiga”).Width = 2 * lembar.Shapes(“segitiga”).Height / (Range(“B1”)) End Sub Sub berputar() Dim lembar As Worksheet Set lembar =
baca selengkapnya…

Membuat Media Fungsi Grfaik dengan VBA Excel

Sub rumus() On Error Resume Next Dim lembar As Worksheet Dim gambar1 As Shape Dim gambar2 As Shape Dim gambar3 As Shape Dim gambar4 As Shape ReDim himpunan(0 To 20 * Range(“B5”), 0 To 1) As Single Set lembar = Worksheets(1) d = lembar.Shapes(“titik”).Left + lembar.Shapes(“titik”).Width / 2 e =
baca selengkapnya…

Membuat Media Animasi Timbangan Menggunakan VBA

Sub coba() On Error Resume Next Dim lembar As Worksheet Set lembar = Worksheets(1) Range(“J6”) = Range(“J6”) + 1 lembar.Shapes(“batang”).Rotation = Range(“j6”) Pi = 4 * Application.WorksheetFunction.Atan2(1, 1) lembar.Shapes(“timbangan”).Left = (lembar.Shapes(“batang”).Left + lembar.Shapes(“batang”).Width – lembar.Shapes(“timbangan”).Width / 2) – (lembar.Shapes(“batang”).Width / 2) * (1 – Cos(Range(“J6”) * Pi / 180)) lembar.Shapes(“timbangan”).Top
baca selengkapnya…