Presentasi sedang didownload. Silahkan tunggu

Presentasi sedang didownload. Silahkan tunggu

Visual Basic Ira. Form Load namaform ->membuka Unload namaform ->menutup Unload me ->menutup Namaform.show ->menampilkan form Metode Form.

Presentasi serupa


Presentasi berjudul: "Visual Basic Ira. Form Load namaform ->membuka Unload namaform ->menutup Unload me ->menutup Namaform.show ->menampilkan form Metode Form."— Transcript presentasi:

1 Visual Basic Ira

2 Form

3 Load namaform ->membuka Unload namaform ->menutup Unload me ->menutup Namaform.show ->menampilkan form Metode Form

4 KONDISI If (kondisi) then ….ekspresi… End if If (kondisi) then ….ekspresi 1… ElseIf (kondisi) then ….ekspresi 2… Else ….ekspresi 3… End if Select Case ekspresi Case nilai: ….ekspresi 1… Case nilai : ….ekspresi 2… Case else nilai : ….ekspresi 3… End select

5 KONDISI

6 Dim mark As Integer Dim grade As String Randomize Timer mark = Int(Rnd * 100) Cells(1, 1).Value = mark If mark = 0 Then grade = "F" Cells(2, 1).Value = grade ElseIf mark = 20 Then grade = "E" Cells(2, 1).Value = grade ElseIf mark = 30 Then grade = "D" Cells(2, 1).Value = grade ElseIf mark = 40 Then grade = "C-" Cells(2, 1).Value = grade ElseIf mark = 50 Then grade = "C" Cells(2, 1).Value = grade ElseIf mark = 60 Then grade = "C+" Cells(2, 1).Value = grade ElseIf mark = 70 Then grade = "B" Cells(2, 1).Value = grade ElseIf mark -80 Then grade = "A" Cells(2, 1).Value = grade End If

7 KONDISI Select Case Grade Case Is >= 90 LetterGrade = "A" Case Is >= 80 LetterGrade = "B" Case Is >= 70 LetterGrade = "C" Case Is >= 60 LetterGrade = "D" Case Else LetterGrade = "Sorry" End Select

8 LOOP Instruksi program yang memerintahkan suatu tugas diulang-ulang berdasarkan kondisi tertentu. 1.Do While (kondisi) ….ekspresi … Loop 2. Do Until (kondisi) ….ekspresi … Loop 3. For counter=nilai awal to nilaiakhir ….ekspresi … Next counter

9 LOOP For i = 1 to 10 Cells(i, 5) = i Next I For i = 1 to 10 Step 2 Cells(i, 5) = i Next I For i = 10 to 1 Step -2 Cells(i, 5) = i Next i i = 1 Do While i =< 10 Cells(i, 1) = i i = i + 1 Loop i = 1 Do Cells(i, 1) = i i = i + 1 Loop While i < 11

10 LOOP

11 INPUTBOX & MsgBOX Hasil=Inputbox(pesan,judul,default,intxpos t,intypost) Msgbox(pesan,inttype,judul)

12 MsgBOX

13 Private Sub CommandButton2_Click() MsgBox ("Welcome to VBA Programming") End Sub Private Sub CommandButton3_Click() Dim message As Integer message = MsgBox("Click Yes to Proceed, No to stop", vbYesNoCancel, "Login") If message = 6 Then Range("D1").Value = "You may proceed" ActiveWorkbook.Activate ElseIf message = 7 Then ActiveWorkbook.Close End If End Sub Private Sub CommandButton4_Click() Dim message As Integer message = MsgBox("Click Yes to Proceed, No to stop", vbYesNo, "Login") If message = 6 Then Range("D2").Value = "You may proceed" ActiveWorkbook.Activate ElseIf message = 7 Then ActiveWorkbook.Close End If End Sub

14 Array Kumpulan data yang bertipe sama. Dim namaarray(2) as interger array(1)=“Bambang” array(2)=“Romi”

15 Array Dim Arr(6) Arr(1) = "Jan" Arr(2) = "Feb" Arr(3) = "Mar" Arr(4) = "Apr" Arr(5) = "May" Arr(6) = "Jun" MsgBox Arr(1) & "-" & Arr(2) & "-" & Arr(3) & "-" & Arr(4) & "-" & Arr(5) & "-" & Arr(6)

16 tugas

17 Numeric Data Types

18 Non-numeric Data Types


Download ppt "Visual Basic Ira. Form Load namaform ->membuka Unload namaform ->menutup Unload me ->menutup Namaform.show ->menampilkan form Metode Form."

Presentasi serupa


Iklan oleh Google