Anda di halaman 1dari 2

Sub Rerata()

'
' Rerata Macro
' Macro recorded 11/5/2012 by 125524239
'
' Keyboard Shortcut: Ctrl+a
'
Range("C3:D10").Select
Selection.Sort Key1:=Range("D4"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("D11").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-6]C:R[-2]C)/5"
Range("D11").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("C3:D10").Select
Application.CutCopyMode = False
Selection.Sort Key1:=Range("C4"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ActiveCell.FormulaR1C1 = ""
Range("D3").Select
End Sub
Sub Macro2()
'
' Macro8 Macro
' Macro recorded 11/5/2012 by 125524239
ActiveCell.FormulaR1C1 = "Mesran"
Range("D4").Select
If ActiveCell.FormulaR1C1 >= "10" Then
Range("D6").Select
ActiveCell.FormulaR1C1 = "=R[-2]C*R[-2]C[3]*.9"
Else
Range("D6").Select
ActiveCell.FormulaR1C1 = "=R[-2]C*R[-2]C[3]"
Range("D7").Select
End If
' Keyboard Shortcut: Ctrl+w
'
End Sub
Sub Macro3()
'

' Macro9 Macro


' Macro recorded 11/5/2012 by 125524239
Dim jumlah, harga As Double
Dim Total As Double
If Range("D3").Value = "Mesran" Then
harga = 50000
End If
If Range("D3").Value = "Top 1" Then
harga = 65000
End If
If Range("D3").Value = "Penzoile " Then
harga = 75000
End If
jumlah = Range("D4").Value
If Range("D4").Value >= 10 Then
Total = jumlah * harga * 0.9
Else
Total = jumlah * harga
End If
Range("D6").Value = Total
' Keyboard Shortcut: Ctrl+g
'
End Sub