Showing posts with label Microsoft excel. Show all posts
Showing posts with label Microsoft excel. Show all posts

Saturday 14 March 2015

Komponen microsoft excel

Apa saja komponen microsoft excel?
1. Worksheet
2. Sheet
3. Cell

Bagaimana mereferensikan suatu worksheet dari worksheet lain?

Thursday 20 November 2014

Menciptakan fungsi buatan sendiri di Macro Microsoft Excel

Referensi: http://office.microsoft.com/en-au/excel-help/creating-custom-functions-HA001111701.aspx

1. Harus insert module
2. Copy code berikut ke jendela Book1 - Module1(Code)
Function tambah(a, b)
c = a + b
MsgBox (c)
End Function

Fungsi diatas menambahkan argumen a dan argumen b kedalam c dan menampilkan hasilnya di jendela msgbox.

Fungsi buatan sendiri harus dimulai dengan kalimat Function dan diakhiri dengan kalimat End Function.

Komponen fungsi: nama fungsi (dalam hal ini aloha) dan argumen-argumen (dalam hal ini a dan b) dan procedure.
1. Nama fungsi = bebas / terserah; lebih baik beri nama yang mencerminkan nilai yang dikandungnya.
2. Argumen-argumen = bisa tidak ada argumen, bisa sampai 29 argumen maksimum dengan menambahkan koma-koma diantaranya.
3. Procedure

Fungsi buatan sendiri berbeda dengan macro dan berbeda dengan Excel's built-in function. Contoh Excel's built-in function: RAND(), NOW().



3. Kembali ke jendela kotak-kotak excel dengan menekan tombol alt + F11 dan pada salah satu sel ketik "=aloha(A1;A2)" (tanpa tanda petik)




Beberapa contoh lainnya:
1.
Function Discount(quantity, price)
    If quantity >= 100 Then
        Discount = quantity * price * 0.1
    Else
        Discount = 0
    End If
    Discount = Application.Round(Discount, 2)
End Function
 
 

Fungsi diatas pada dasarnya mengerjakan apabila jumlah barang yang dibeli (kuantitas barang)
lebih besar dari 100 barang maka mendapatkan diskon sebesar 0.1. Sebaliknya, jika jumlah
barang yang dibeli dibawah 100 tidak ada diskon / potongan harga.
 
 

Sunday 18 May 2014

Membuat Form Sederhana Inputan di Microsoft Excel

1. Buka microsoft excel
2. Keluarkan tab developer
3. Klik tab developer
4. Klik icon Visual Basic
5. Pada jendela Project - VBA project di sebelah kiri, klik kanan pada Sheet1 , pilih Insert, pilih UserForm.Muncul tampilan seperti berikut:
Note: UserForm1 telah terbuat, jadi yang muncul UserForm2


 6. Pada jendela Toolbox, keluarkan atau drag 1 buah control CommandButton dan 1 buah TextBox. Dan letakkan di jendela UserForm2 satu persatu. Susun sedemikian rupa letaknya seperti berikut:


7. Klik CommandButton dan isikan code berikut ini diantara Private Sub CommandButton1_Click() dan End Sub.

Sheet1.Activate
Range("A2").Select
ActiveCell.FormulaR1C1 = TextBox1.Text
MsgBox (TextBox1.Text)

8. Klik Run atau tekan tombol F5 pada keyboard. Form itu akan berjalan dan tampil seperti berikut:


9. Ketik suatu angka di kolom textbox. Setelah selesai memasukkan angka di kotak textbox, klik CommandButton1. Viola, sel A2 di Sheet1 kamu sudah terisi dengan angka yang sama dengan angka yang kamu masukkan di kotak textbox. Contoh:


Segitu aja, semoga bermanfaat.

Sunday 11 May 2014

Cara mengingat formula yang baru kamu masukkan di microsoft excel

Cara mengingat formula yang baru kamu masukkan di microsoft excel adalah dengan:
Mengetik kembali formula itu ke dalam notepad atau ke blog seperti yang saya lakukan ini(tanpa harus melihat formula yang baru kamu masukkan)
Contoh:
=sqrt(power(a1,2)+power(b1,2))
alias nilai hypotenusa

Bila cara ini kamu lakukan dan kamu publish (jika menggunakan media blog) kamu akan melihat/memvisualisasikan gambaran global / keseluruhannya dan kamu sendiri jadi lebih mengerti.

Semoga bermanfaat.

Monday 30 December 2013

Error log VBA


1. #NAME?
Example:
=cetak
using incomplete(do not list a parameter); calling a function but do not supply argument
=aloha()
calling unexist function
=aloha
calling unexist function (although with different notation)

2. #VALUE?
Example:
=mesin()
"not supplying parameters"

Wednesday 25 December 2013

MS. Excel: Data analysis

Analysis tools
1. Anova: Single Factor
2. Anova: Single Factor With Replication
3. Anova: Two-factor Without Replication
4. Correlation
5. Covariance
6. Descriptive Statistics
7. Exponential smoothing
8. F-test two Sample using variance
9. Fourier analysis
10. Histogram
11. Moving Average
12. Random Number Generation
13. Rank and Percentile
14. Regression
15. Sampling

Data:
1. Single data
2. Group of data

Upon sets of data:
1. find the simmilliarity

MS. Excel: Perform a regression analysis

Their types

Types of regression:
1. Linear regression
2. Exponential regression
3. Multiple regression

Their calculating

Linear regression
x is dependent
y is independent


LOGEST function
you use it to analyze data that is non-linear

GROWTH function
Find points that lie along that curve

SLOPE function

Tuesday 24 December 2013

When did you use Microsoft excel VBA

Use microsoft excel vba when do:
1. Repetitive task (search and find)
2. Modified task

But the basic is excel menu itself. The VBA is just its complement.

Sunday 22 December 2013

Microsoft Excel Basic Coding

Yang berhubungan dengan Cell

How to refer to one cell in a particular sheet?
Style1: Using range property
Use: Range property + A1 Notation

Example:

Sub onecell()
    Sheet1.Range("A1").Select
End Sub

Style 2: Using index number
Use: Row Index number, Column index number, cells property
Example:
Sub onecell()
    Sheet1.cells(1,1).Select
End Sub

Note: Also good for used with looping statement.

How to refer to one cell that relative to another active cell? (Relativity)
Use: offset property
Example:
This can be both do to style 1 and style 2

Sub onecell()
    Sheet1.cells(1,1).offset(1,2).Value = 10
end sub


How to refer to cells (more than one cell)
Style1: Using A1 Notation
Use: Range property + A1 Notation
Example:
Sub manycells1()
    Sheet1.Range("A1:A3").Select
End Sub

Style2: Using Range Object
Use: dim, set, object variable

Example:
sub manycells2()
    dim a as range
    set a = sheet1.range("A1:A3")
    a.select
end sub

Style3: Using shortcut notation
As the title implies, this is the shorcut of using Range word. That is, you don't have to type word Range or use Quotation marks anymore for shortcuts.

Use: [A1:A2] or [MyRange] if you have define those cells in name manager.

Example:
Sub manycells()
    Sheet1.[MyRange].Select
End sub

Note: You don't have to type word "Range" or use Quotation marks after Sheet1.

How to refer to all cell in a particular sheet
Use: cells
Example:
sub allcell()
    sheet1.cells.activate
end sub


Yang berhubungan dengan Sheet

How to refer a one sheet?
Style 1:
Use Worksheets name
Example:
Sub onesheet()
    Worksheets("sheet2").Select
End Sub

Style2: 
Use Worksheets index number
Example:
Sub onesheet()
    Worksheets(2).Select
End Sub

How to refer to more than one sheets?
Use: worksheets property and array function
Example:
Sub several_sheets()
    worksheets(Array("Sheet1","Sheet2")).Select
end sub

How to refer to all sheet in a workbook?
Use: Worksheets property without specifications.
Example:
Sub all_sheet()
    Worksheets.Select
End Sub

Yang berhubungan dengan Workbook

How to create a new workbook
Use: workbooks.add
Example:
Sub AddOne()
    Workbooks.add
End sub

How to activate a workbook
Use: workbooks properties and book name(for i.e. : "book1")
Example:
Sub ActivateOne()
    Workbooks("book1").activate
End sub

How to open a workbook
Use: Open method and, path to the file
Example:
Sub OpenUp()
    Workbooks.Open ("C:\Mybook")
End Sub
How to save a workbook
Use: saves or save and path to the file

Example:
Sub Save()
    Workbooks("Mybook").SaveAs ("E:\Mybook")
End Sub

Now you have enough tool to do these tasks:
1. Copy and paste from sheet1 to sheet2
Untuk pemilihan sel saya lebih prefer menggunakan keyword range daripada cells (lebih praktis) meskipun untuk seleksi satu sel saja saya tetap menggunakan keyword range.

Sub copy_paste()
    Sheet1.Range("A1:A2").Copy
    Sheet2.Range("A1:A2").PasteSpecial
End Sub

Well, you can implement those with macro recording though.

2. Adding a comment on a cell or cells
Sub

List of methods (function) of a cell

List of methods (function) of a cell, a block of cells (they are having same methods):
1. Activate
2. AddComment
3. AdvancedFilter
4. ApplyNames
5. ApplyOutlineStyles
6. AutoComplete
7. AutoFill
8. AutoFilter
9. AutoFit
10. AutoOutline
11. BorderAround
12. Calculate
13. CalculateRowMajorOrder
14. CheckSpelling
15. Clear
16. ClearComments
17. ClearContents
18. ClearFormats
19. ClearNotes
20. ClearOutline
21. ColumnDifferences
22. Consolidate
23. Copy
24. CopyFromRecordSet
25. CopyPicture
26. CreateNames
27. Cut
28. DataSeries
29. Delete
30. DialogBox
31. Dirty
32. EditionOptions
33. ExportAsFixedFormat
34. FillDown
35. FillLeft
36. FillRight
37. FillUp
38. Find
39. FindNext
40. FindPrevious
41. FunctionWizard
42. Group
43. Insert
44. InsertIndent
45. Justify
46. ListNames
47. Merge
48. NavigateArrow
49. NoteText
50. Parse
51. PasteSpecial
52. PrintOut
53. PrintPreview
54. RemoveDuplicates
55. RemoveSubtotals
56. Replace
57. RowDifferences
58. Run
59. Select
60. SetPhonetic
61. Show
62. ShowDependents
63. ShowErrors
64. ShowPrecedents
65. Sort
66. SortSpecial
67. Speak
68. SpecialCells
69. SubscribeTo
70. SubTotal
71. Table
72. TextToColumns
73. Ungroup
74. Unmerge