Showing posts with label minipost. Show all posts
Showing posts with label minipost. Show all posts

Saturday, December 4, 2010

Trik Membuat Menu Navigasi dengan CSS

clip_image001Template yang di sediakan juga sudah tersedia menu navigasinya.Nah bagi yang mempunyai template yang disukai,namun belum ada menu navigasinya untuk itu baca selengkapnya trik ini untuk membuat menu navigasi dengan CSS.


1.Sebelum membuat menu navigasinya,coba anda check dulu pada bagian ukuran lebar template agar sesuai dan serasi.misalnya didalam template anda kodenya seperti ini:

/*————BODYGUE—————*/
body {
background: #000 ;repeat-x bottom;
width: 980px;
color: #333;
font-size: 12px;
font-family: lucida sans unicode,century gothic,Tahoma, Verdana;
margin: 0 auto 0;
padding: 0;
}


Menunjukkan lebar headernya adalah 980pixel berbackground warna hitam.Langkahnya sebagai berikut:
1.Masuk pada akun blogger anda..
2.Pada dasbor blog pilih pada edit tata letak
3.Pilih edit html
4.Cheklist pada Expand Widget diatas kolom html
5.Untuk mempercepat pencarian tekan Ctrl+F
Tugas anda yang pertama adalah menyisipkan kode berikut sebelum ]]</b:skin>

/* Navigasi frj1dotwordpressdotcom
———————————————– */
#fajar{
height:25px;
text-align: center;
}

#fajar a{
margin:0;
font-size:1.2em;
font-weight:bold;
letter-spacing:-1px;
background-color: #cccccc;
color: #000000;
padding-top:2px;
padding-bottom:2px;
padding-left:4px;
padding-right:4px;
}

#fajar a:hover{
text-decoration:none;
padding:34px 5px 41px 5px;
background-color: #0326FC;
background-repeat: repeat-x;
color:#A7FC03;
padding-top:2px;
padding-bottom:2px;
padding-left:4px;
padding-right:4px;
}

6.Selanjutnya copas kode berikut dibawah <div id=”header”>

<h1 id=”blog-title”>
<ItemPage><a href=”<GUE>”></ItemPage>
<$BlogTitle$>
<ItemPage></a></ItemPage>
</h1>

<id=”description”><GUE>
<div id=”fajar”>
<a href=”fjr1.wordpress.com ” target=”_blank”>Home</a>
<a href=”this-trik.blogspot.com/2010/04/trik-membuat-menu-navigasi-dengan-css.html”  target=”_blank”>Trik menu nav</a>
<a href=”#” target=”_blank”>Link 3</a>
<a href=”#” target=”_blank”>Link 4</a>
<a href=”#” target=”_blank”>Link 5</a>
</div>

</div>

7.Klik Pratinjau untuk melihat hasilnya.

(Sumber)  by fajar

Tag Technorati: {grup-tag},

Friday, November 26, 2010

Instal Wordpress dengan Domain Gratis dan Hosting Gratis

clip_image001
Instal Wordpress dengan Domain Gratis dan Hosting Gratis
Membuat Website di www.000webhost.com, bahwa dalam pendaftaran 000webhost, kita disuguhi pilihan untuk pengisisan domain yaitu “I want to host my own domain” dan “or, I will choose your free subdomain”.
Disini marilah kita buat my own domain dengan menggunakan co.cc dan install Wordpress di hosting 000webhost.
Langkah-langkah Install Wordpress di Hosting dan Domain Gratis ( 000webhost & co.cc )
Persiapan Domain
  • Cek dulu nama domain yang kamu inginkan apakah masih ada atau tidak di co.cc. Kalau memang ada registerkan domain tersebut ke co.cc, kalau tidak ada ya… cari nama lainnya < ![endif]--><!--[if !vml]--><!--[endif]-->
  • Login ke account di co.cc
  • Masuk ke menu my account
  • klik edit (kalau masih baru domain kita biasanya ada link di bawah service type) domain kita
  • Pilih option 1 : Manage DNS
  • Berhubung kita pakai hosting dari 000webhost, isi name server sebagai berikut
Name Server1 : dns1.000webhost.com
Name Server2 : dns2.000webhost.com

  • Klik tombol Setup Domain
  • Biasanya domain akan aktif dalam waktu 1-2 hari
Setting Hosting
Masuk ke 000webhost
  • Pilih menu Order Now, kalau dah jadi member masuk ke client login > manage account > Creat new account
  • isi kotak I want to host my own domain dengan domain co.cc kita (misal:ikhsanprayoga.co.cc)
Catatan: Ketika proses setting tunggu bebeapa saat. Jangan refresh browser. Nanti akan ada pemberitahuan hasil setup kita.
  • Setelah selesai daftar, kita akan di berikan keterangan. Perhatikan baik- baik bagian di bawah:
Domain: ikhsanprayoga.co.cc
IP Address: ***.***.***.***:****
Server Hostname: server6.890m.com

Your website address: http://ikhsanprayoga.co.cc/
Access your cPanel at http://ikhsanprayoga.co.cc/cpanel or http://***.***.***.***:****

cPanel Username: ********
cPanel Password: *********

  • login ke control panel melalui http://***.***.***.***:****. Masukkan cPanel username dan cPanel passwordnya. Kalau domain kita sudah aktif kita bisa masuk lewat http://ikhsanprayoga.co.cc/cpanel.
  • Pilih software > fantastico > wordpress > klik new instalation
  • Isikan nama admin (digunakan saat login ke dashboard wordpress), dan passwordnya. untuk yang lainnya bisa di abaikan dulu. Stop dulu.
  • Buka jendela baru > masuk ke cpanel > file manager > web root > Hapus file index.php,
  • klik Install Wordpress
  • Setelah proses, klik finish installation
  • klik back to wordpress overview
Setelah selesai install cek di browser kamu dengan ip di keterangan account, http://***.***.***.***:**** apakah blog kita sudah bisa di akses. Kalau domain kita sudah aktif bisa deh pakai http://ikhsanprayoga.co.cc (basanya ini membutuhkan waktu 1 hari)
Setelah selesai Install Wordpress kita bisa mulai posting lewat http://ikhsanprayoga.co.cc/wp-login.php (untuk yang bisa install di root) atau http://ikhsanprayoga.co.cc/blog/wp-login.php (buat yang install di folder blog).
Sekian dulu semoga bermanfaat.
Tag Technorati: {grup-tag},,

VBA in ECXEL

VBA in ECXEL

VBA („Visual Basic for Applications“) ist eine Basic-Programmiersprache, die speziell für die MS-Office Programme entwickelt wurde und zwei Zielen dient:
· Arbeit automatisieren, indem Befehlsfolgen in einem einzigen Befehl zusammengefasst werden (sog. „Makro“)
· Funktionsumfang erweitern, indem die vorhandenen Befehle durch selbstgeschriebene Befehle ergänzt werden
Makros lassen sich über das Menü „Extras – Makro – Aufzeichnen ...“ wie mit einem Videorecorder aufnehmen und speichern. Alle Mausklicks und Tastendrücke werden aufgenommen, bis das Symbol „Aufzeichnung beenden“  angeklickt wird. Über „Extras – Makro – Makros ...“ kann es jederzeit abgespielt werden.
Eigenhändige VBA-Programmierung bietet mehr Möglichkeiten, verlangt aber auch mehr Aufwand. Zuerst den VBA-Editor öffnen: „Alt+F11“ oder „Extras – Makro – Visual Basic-Editor“. Befehle können nur innerhalb von Unterprogrammen stehen (sie beginnen mit „sub“ und einem frei wählbaren Namen):
sub Berechnen()
...
end sub
Außerhalb (d.h. oberhalb) dieser Unterprogramme sind nur globale Variablendeklarationen erlaubt, z.B.:
dim daten as SeriesCollection
Auf Zellinhalte oder Diagramme greift man über die unzähligen Objekte zu, aus denen eine Excel-Datei besteht:
An oberster Stelle steht das Objekt „application“, aber da klar ist, dass wir uns in der Applikation Excel befinden, kann es weggelassen werden. Darunter folgt das Arbeitsblatt. Zugriff entweder über die Auflistung „worksheets“, die in Klammer die Nummer des Arbeitsblatts bzw. dessen Namen verlangt, oder über „ActiveSheet“ (= das momentan bearbeitete Tabellenblatt):
worksheets(1) oder worksheet("Verkäufe") oder ActiveSheet
Unterhalb des Tabellenblatts verzweigt sich die Hierarchie: will man den Inhalt bestimmter Zellen ändern oder auslesen, benötigt man das „Range“-Objekt (Beispiel: in die Zelle A3 wird die Zahl 12,5 geschrieben – Achtung auf das Dezimaltrennzeichen (Punkt, nicht Beistrich)!):
worksheets(1).Range("A3").Value = 12.5
Formatierungen von Zellen erlaubt das Objekt „Interior“ (Beispiel: die Zellen H3 bis I4 erhalten rote Hintergrundfarbe):
Worksheets(1).Range("H3:I4").Interior.ColorIndex = 3
Diagramme erreicht man über das Objekt „chart“ und die Auflistung „chartobjects“ (enthält alle Diagramme dieses Tabellenblatts). Die einzelnen Datenreihen über die Auflistung „SeriesCollection“, einzelne Datenpunkte über die Auflistung „Points“. Beispiel (der zweite Datenpunkt der ersten Datenreihe erhält eine Datenbeschriftung):
Worksheets(1).ChartObjects(1).Chart.SeriesCollection(1).Points(2).HasDataLabel = True
Wie man sieht, kann die Objektliste recht lang werden. Der Übersichtlichkeit zuliebe deklariert man besser mit dim eine Objektvariable und weist ihr das gewünschte Objekt mit „set“ zu (Beispiel: die Variable „daten“ soll die Auflistung SeriesCollection enthalten):
dim daten as SeriesCollection
set daten = Worksheets(1).ChartObjects(1).Chart.SeriesCollection
Der Zugriff vereinfacht sich nun:
daten(1).points(2).HasDataLabels = True
Beachte den Unterschied zwischen Datenreihe (SeriesCollection) und Datenpunkt (Points)! Im folgenden Beispiel gibt es 5 Datenpunkte mit je zwei Datenreihen. Der zweite Datenpunkt der ersten Datenreihe bekommt rote Füllfarbe, alle Datenpunkte der zweiten Datenreihe eine Datenbeschriftung:

2.Datenpunkt, 1.Datenreihe:
ActiveSheet.ChartObjects(1).Chart.SeriesCollection(1).Points(2).Interior.ColorIndex = 3
alle Datenpunkte, 2 Datenreihe:
ActiveSheet.ChartObjects(1).Chart.SeriesCollection(2).HasDataLabels = True
Zum Ausprobieren selbst geschriebenen VBA-Codes gibt es zwei Wege:
Man erzeugt über „Extras – Makro – Makros ...“ ein neues Makro (Namen eingeben und mit Klick auf „Erstellen“ bestätigen) und schreibt dort den VBA-Code hinein. Dieses Makro kann man anschließend wie jedes aufgezeichnete Makro aufrufen und natürlich auch als Symbol in die Symbolleiste integrieren („Extras – Anpassen – Symbolleiste – Befehle - Makros“).
Der zweite, interessantere Weg führt über Ereignisse, auf die unsere VBA-Prozeduren als sog. „Ereignisprozeduren“ oder „Event-Handler“ reagieren. In Frage kommen vor allem zwei Ereignisse:
1) Daten im Tabellenblatt wurden geändert
Das entsprechende Ereignis lautet „Change“ und wird bei jeder Änderung in einer beliebigen Zelle des Tabelenblatts ausgelöst. Der dazugehörende Event-Handler verlangt eine ganz bestimmte Schreibweise (im folgenden Beispiel wird bei jeder Änderung einer beliebigen Zelle in die Zelle H3 der Text „erwischt!“ geschrieben):
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Range("H3").Value = "erwischt!"
End Sub
Ereignisprozeduren beginnen grundsätzlich mit dem Schlüsselwort „Private“. Da es sich um ein Ereignis des Tabellenblatts handelt, steht im Prozedurnamen „Worksheet“ vor dem eigentlichen Ereignis („Change“). In Klammer folgt ein „Parameter“ (damit wir erfahren, welche Zelle geändert wurde). Natürlich muss man nicht sämtliche Ereignisse und deren genaue Schreibweise auswendig lernen. Mit Mausklick auf das rechte obere Listfeld im Codefenster wird ein Prozedurrumpf in der korrekten Schreibweise von Excel selbst erzeugt (im linken Listfeld zuvor „Worksheet“ auswählen):
Im rechten Listfeld das gewünschte Ereignis wählen
Im linken Listfeld „Worksheet“ auswählen
2) Das zweite wichtige Ereignis wird von Mausklicks auf Schalter ausgelöst. Als erstes müssen wir die „Toolbox“ („Ansicht – Symbolleisten – Steuerelement-Toolbox“) auf den Bildschirm bringen. In dieser Toolbox befindet sich u.a. das Werkzeug „Befehlsschaltfläche“. Mit Mausklick darauf auswählen und mit gedrückter Maustaste auf dem Tabellenblatt ein Rechteck aufziehen. Mausklick mit der rechten Maustaste in dieses Rechteck öffnet ein Popup-Menü, mit dem sich das „Eigenschaften“-Fenster öffnen lässt. Hier kann man nach Lust und Laune das Aussehen des Schalters bestimmen – und natürlich auch die Beschriftung (Eigenschaft „Caption“). Die wichtigste Eigenschaft jedoch ist „Name“, denn dieser wird Bestandteil des Eventhandlers sein. Sobald man im Eigenschaften-Fenster alles nach Wunsch eingestellt hat, kommt der wichtigste Schritt:
Mit rechter Maustaste in die Schaltfläche klicken, Mausklick rechts öffnet das bekannt Popup-Menü, den Eintrag „Code anzeigen“ wählen – und endlich sind wir wieder im VBA-Editor. Ein Prozedurrumpf mit dem Namen der Schaltfläche wurde bereits von Excel angelegt. Wie man sieht, besteht eine Ereignisprozedur für Schaltflächen aus dem Namen, den man der Schaltfläche im Eigenschaften-Fenster gegeben hat, und – durch Unterstrich getrennt – dem Wörtchen „Click“:
Private Sub bovp_Click()
End Sub
Wir müssen nur noch den VBA-Code in diesen Rumpf hineinschreiben und fertig sind Schaltfläche und Eventhandler.
Wichtig: um den Schalter testen zu können, muss in der Toolbox der „Entwurfsmodus“ ausgeschaltet werden. Umgekehrt ist er wieder einzuschalten, wenn wir die Schalter-Eigenschaften neuerlich bearbeiten wollen.

Beispiel: animiertes Säulendiagramm

Aufgabe: die Ergebnisse der Vorarlberger Landtagswahlen vom 19.9.2004 sollen in einem Säulen-Diagramm angezeigt werden. Die einzelnen Säulen sollen auf Mausklick in die Höhe wachsen und anschließend oberhalb ihre Datenbeschriftung einblenden.
Die Daten befinden sich bereits fertig in einer Tabelle. Das Diagramm bekommt seine Daten allerdings aus den Spalten „D“ (für 2004) und „G“ (für 1999), in denen alle Zellen auf „0“ gesetzt sind. Das hat seinen guten Grund: denn die Säulen des Diagramms sollen ja zu Beginn unsichtbar sein und erst auf Mausklick in die Höhe wachsen. Im Eventhandler des Schalters merken wir uns daher die tatsächlichen Endwerte (sie stehen in den Spalten „C“ für 2004 und „F“ für 1999) in zwei Variablen („max04“ und „max1999“) und füllen anschließend in einer for ... next - Schleife allmählich die Spalten „D“ und „G“ (aus denen das Diagramm seine Daten bezieht), beginnend bei „0“ bis zum Endergebnis.
Da alle fünf Schalter das gleiche tun – nur mit verschiedenen Datenpunkten - , bietet es sich an, die eigentliche Ereignisverarbeitung in eine Unter-Prozedur zu stellen (ich nenne sie „Zeichnen“) und diese von den Schaltern aufrufen zu lassen. Als Parameter erwartet sie in der Variablen „punkt“ die Nummer des Tabellenzeile, in der die Werte für das Diagramm stehen (D6 bis D10). Die fünf Event-Handler der Schalter lauten somit:
Private Sub bovp_Click()
zeichnen punkt:=6
End Sub
-------
Private Sub bspo_Click()
zeichnen punkt:=7
End Sub
-------
Private Sub bfpo_click()
zeichnen punkt:=8
End Sub
-------
Private Sub bgruen_Click()
zeichnen punkt:=9
End Sub
-------
Private Sub bdiv_Click()
zeichnen punkt:=10
End Sub
In der Prozedur „Zeichnen“ deklarieren wir zuerst ein paar Variablen und füllen anschließend in der genannten „for ... next“ – Schleife die erste Datenreihe des aktuellen Datenpunktes:
Sub zeichnen(punkt As Integer)
Dim AktZeit As Single
Dim daten As SeriesCollection
Dim i As Integer
Dim max04 As Single
Dim max99 As Single
Set daten = ActiveSheet.ChartObjects(1).Chart.SeriesCollection
max04 = ActiveSheet.Range("C" & punkt).Value
max99 = ActiveSheet.Range("F" & punkt).Value
For i = 0 To max04
ActiveSheet.Range("D" & punkt).Value = i
AktZeit = Timer
Do While Timer < aktzeit + 0.01
DoEvents
Loop
Next
Da im Parameter „punkt“ die Nummer der Tabellenzeile geliefert wird, in der die Daten des Diagramms stehen (mögliche Werte: zwischen 6 und 10), können wir mit ("C" & punkt) die entsprechende Zelladresse basteln (z.B. „D7“, wenn punkt = 7). Über die Eigenschaft „value“ haben wir Zugriff auf den Zellinhalt, der in der for ... next – Schleife langsam gefüllt wird und damit das Diagramm, das seine Werte aus dieser Zelle bezieht, allmählich wachsen lässt.
Eine Warteschleife („do while ... loop“) sorgt dafür, dass die Säulen nicht schlagartig in den Himmel schießen. Die Funktion „timer“ liefert die aktuelle Uhrzeit, und zwar als reelle Zahl: die Vorkommastellen geben die Anzahl Sekunden an, die Nachkommastellen die 1/100 Sekunden. Wir merken uns die aktuelle Zeit in der Variablen „AktZeit“ und fragen solange die Uhrzeit ab, bis sie 0,01 Sekunden weitergerückt ist. Tatsächlich ist nicht genau vorhersagbar, wie lange die Verzögerung dauert. Denn der Aufruf von „DoEvents“ veranlasst Excel, für einen Moment die Kontrolle an Windows abzugeben (damit die Wartezeit genützt und der Computer nicht blockiert wird).
Zuletzt möchten wir noch, dass oberhalb der Säule ihre Datenbeschriftung eingeblendet wird. Die soll natürlich genau sein, aber die Variable „i“, die in der for ... next – Schleife als Zählvariable gedient und die Zelle „D & punkt“ gefüllt hat, war eine Ganzzahl („integer“) – musste sie auch sein, denn reelle Zahlen sind als Zählvariable nicht erlaubt – und lieferte daher keine Kommastellen. Damit die Beschriftung dennoch den exakten Wert inklusive Kommastellen (für die Säule „ÖVP - 2004“ z.B. „54,9“) anzeigt, müssen wir nach Ende der for ... next – Schleife noch einmal den Inhalt der Spalte „C“, den wir uns zu Beginn in der Variablen „max04“ (Datentyp „Single“ – daher mit Nachkommastellen) gemerkt haben, in die Spalte „D“ übertragen:
ActiveSheet.Range("D" & punkt).Value = max04
Um die Beschriftung auch tatsächlich sehen zu können, wird sie erst einmal eingeschaltet. Die Aufzählung „points“ erwartet in Klammer die Nummer (sog. „Index“) des Datenpunkts, beginnend mit „1“. Da in der Variablen „punkt“ die Zeilennummer der zum Diagramm gehörenden Tabellenspalte steht (beginnend mit „6“), subtrahieren wir einfach „5“ und kommen damit auf den richtigen Index:
daten(1).Points(punkt - 5).HasDataLabel = True
Für die korrekte Anzeige der Kommastelle (wir wollen aus Platzmangel nur eine sehen) sorgt die Formatanweisung an die Eigenschaft „NumberFormat“ der Datenbeschriftung (Objekt „DataLabel“):
daten(1).Points(punkt - 5).DataLabel.NumberFormat = "#0.0"
Damit ist die erste Datenreihe fertig (hier am Beispiel der Säule „ÖVP“, d.h. Variable punkt = 6):
Klick auf Schalter „ÖVP“ zeichnet zuerst die Säule für 2004 (Datenpunkt 1, Datenreihe 1) und darüber die Datenbeschriftung („54,9“) ...
... anschließend die Säule für 1999 (Datenpunkt 1, Datenreihe 2) mit Datenbeschriftung („45,7“)
Genau die gleichen Schritte folgen für die zweite Datenreihe. Zuletzt wird die mit „set“ belegte Objektvariable „daten“ wieder freigegeben (set daten = nothing). Zusätzlich könnte man noch einen „Reset“-Schalter einfügen, mit dem die Säulen des Diagramms wieder verschwinden: man muss nur in die 5 Zellen der Spalten „D“ und „G“ (D6 – D10 und G6 – G10) den Wert „0“ schreiben - im unten abgedruckten Quellcode befindet sich eine solche Ereignisprozedur unter dem Namen „bClear_Click()“.
Hier noch einmal der komplette Quellcode:
Sub zeichnen(punkt As Integer)
Dim aktzeit As Single
Dim daten As SeriesCollection
Dim i As Integer
Dim max04 As Single
Dim max99 As Single
Set daten = ActiveSheet.ChartObjects(1).Chart.SeriesCollection
max04 = ActiveSheet.Range("C" & punkt).Value
For i = 0 To max04
aktzeit = Timer
ActiveSheet.Range("D" & punkt).Value = i
Do While Timer < aktzeit + 0.01
DoEvents
Loop
Next
ActiveSheet.Range("D" & punkt).Value = max04
daten(1).Points(punkt - 5).HasDataLabel = True
daten(1).Points(punkt - 5).DataLabel.NumberFormat = "#0.0"
max99 = ActiveSheet.Range("F" & punkt).Value
For i = 0 To max99
aktzeit = Timer
ActiveSheet.Range("G" & punkt).Value = i
Do While Timer < aktzeit + 0.01
DoEvents
Loop
Next
ActiveSheet.Range("G" & punkt).Value = max99
daten(2).Points(punkt - 5).HasDataLabel = True
daten(2).Points(punkt - 5).DataLabel.NumberFormat = "#0.0"
Set daten = Nothing
End Sub
Private Sub bovp_Click()
zeichnen punkt:=6
End Sub
-------
Private Sub bspo_Click()
zeichnen punkt:=7
End Sub
-------
Private Sub bfpo_click()
zeichnen punkt:=8
End Sub
-------
Private Sub bgruen_Click()
zeichnen punkt:=9
End Sub
-------
Private Sub bdiv_Click()
zeichnen punkt:=10
End Sub
-------
Private Sub bClear_Click()
Set daten = ActiveSheet.ChartObjects(1).Chart.SeriesCollection
For i = 6 To 10
ActiveSheet.Range("D" & i).Value = 0
ActiveSheet.Range("G" & i).Value = 0
Next
daten(1).HasDataLabels = False
daten(2).HasDataLabels = False
End Sub

Database Dari Visual Basic

Untuk dapat mengakses suatu database dari visual basic, Anda harus membuat koneksi  ke database tersebut. Visual basic dapat menangani berbagai database, teks bakan worksheet excel. Terdapat beberapa cara yang tersedia untuk itu sesuai dengan database yang digunakan

Cara 1. Menggunakan Object ADO

Anda dapat menggunakan icon Adodc (Microsoft ActiveX Data Objects Data Control) pada toolbox. Jika pada toolbox tidak terdapat icon Adodc, Anda dapat menambahkannya dengan memilih menu Project, Components (Ctrl+T) lalu beri tanda pilih pada Microsoft ADO Data Control (OLEDB) dan klik Apply. Sekarang kita akan mencoba mengaitkan database Ms. Acess yang diberi nama Pembelian.mdb. Untuk itu, lakukan langkah-langkah sebagai berikut:


  1. Pilih menu File lalu New.
  2. Pilih VB Enterprise (Professional) Edition Controls.
  3. Klik OK.
  4. Klik ganda pada folder Forms pada jendela proyek lalu klik ganda pada Form 1 sampai muncul tampilan form.
  5. Klik icon Adodc pada toolbox.
  6. Klik dan seret pada jendela form, sehingga muncul tampilan seperti Gb. Objek yang tergambar dalam form disebut objek data.
  7. Tentukan properti data sebagai berikut:
    1. Name db         Pembelian
    2. Caption           Data Barang
    3. EOFAcction   
  8. Tentukan properti ConnectionString dengan cara mengklik tombol … pada kolom ConnectionString sehingga muncul tam pilan seperti pada Gb
  9. Pilih OptionButton pada Use Connection String lalu klik Build sehingga muncul tampilan seperti pada Gb
  10. Pilih Microsoft Jet 4.0 OLEDB Provider lalu klik Next.
  11. Pilih (dengan mengklik tombol …) atau ketik nama database yang dipakai pada kolom Select or enter a database name.
  12. Klik Test Connection jika perlu, lalu kllk OK dua kali sampai tampilan kembali ke jendela Form.
  13. Tentukan properti RecordSource dengan cara mengklik tombol pada kolom RecordSource sehingga muncul tampilan seperti pada Gb
  14. Pada kolom Command Type pilih 2-adCmdTable. Setelah kolom ini diisi, maka Anda akan dapat mengisi kolom Table or Stored Procedure Name. lsilah dengan memilib tabel Barang seperti pada Gb
  15. Klik OK.
  16. Simpan form dan proyek dengan nama VB-Lat-01

Cara 2: Mendeklarasikan Objek Ado

Object ado dapat dideklarasi melalui coding. Tiga object bawaan ADO dalam pengembangan aplikasi adalah :

1. Obcet Connection

untuk menangani koneksi antara program dengan sumber data atau server. Deklarasi dapat bersifat lokal maupun global serta dapat diletakan pada level form, modul atau class modul. ADO paling umum membuka suatu koneksi dengan menggunakan obyek Connection Open metoda. Sintaks untuk Metoda Open ditunjukkan sbb: 

Dim connection as New ADODB.Connection

connection.Open ConnectionString, UserID, Password, OpenOptions

Sebagai alternatif, anda dapat menggunakan teknik pintas, recordset.Open, untuk membuka koneksi yang tersembunyi dan mengeluarkan suatu perintah atas koneksi dalam satu operasi. Lakukan hal ini dengan mengaktivkan suatu koneksi yang valid seperti argumentasi ActiveConnection ke Metoda Open. Ini adalah sintaksis untuk masing-masing metoda di Visual Basic:

Dim recordset as ADODB.Recordset Set

recordset = New ADODB.Recordset

recordset.Open Source, ActiveConnection, CursorType, LockType, Options

Contoh :

Deklarasi object Connection:

     Dim cn As New ADODB.Connection

atau

     Public cn As New ADODB.connection

Selanjutnya mengalokasikan memori untuk onject connection sbb:

     Set cn = New ADODB.Connection

Kemudian isi property object connoction tersebut sbb:

Contoh berikut adalah property untuk MSSQL Server

     cn.connectionString = “Perovider=SQLOLEDB;” & _

                                                 ”Server=NamaServer; ” & _

                                                “Initial catalog= inventory” & _

                                               “user Id = zulidamel” _

                                              “Password=terserah”

     cn.Open

atau

    koneksi =  “Perovider=SQLOLEDB;” & _

                       ”Server=NamaServer; ” & _

                       “Initial catalog= inventory” & _

                       “user Id = zulidamel” _

                       “Password=terserah”

cn.Open koneksi

Jika tidak ingin menggunak authentik pada proses koneksi gunakan cara berikut:     

koneksi = “Provider=SQLOLEDB.1;” & _

                  “Integrated Security Info=False;” & _

                 “Data Source = NamaServer” cn.Open koneksiBila koneksi sudah tidak diperlukan tutuplah koneksi dengan perintah

”Set cn = Nothing”

2. Object Command

Digunakan untuk perintah SQL ke sumber data atau server. Deklarasi object command sbb:

      Dim CmdBarang As New ADODB.Command

atau

     Public Cmd as New ADODB.Command

selanjutnya alokasikan memori untuk object Command sbb:

     Set CmdBarang = New ADODB.Command

Kemudian Isi property object command

      CmdBarang.ActiveConection = cn

     CmdBarang.CommandText = “select * from barang”

      CmdBarang.CommandType = adCmdText

3. Object Recordset

Digunakan sebagao penampung hasil eksekusi dalam bentuk tabel. Deklarasi object record sbb:

      Dim rsBarang As New ADODB.Recordset

atau

      Public rsBarang As New ADODB.Recordset

selanjutnya alokasikan memori ynryk object recordset sbb:

      Set rsBarang = New ADODB.recordset

lalu isikan property object record set

      rsBarang.CusrsorTYpe = adOpenDynamic

     rsBarang.LockType = adLockOptimistic

     rsbarang.Open cmdBarang

atau

   rsbarang,open CmdBarang,, adOpenDynamic, adlockOptimistic,  adCmdtext

Data Control

Visual Basic terus berkembang dalam pengembangan general purpose Windows, tetapi kemampuan database tidaklah bagian murni dari desainnya. Data Control,  Visual Basic menambahkan, membuat Visual Basic suatu alat yang jauh lebih tangguh untuk pembuatan pemrograman database.

clip_image001Data Control memberikan kemudahkan untuk mendapat data ke dalam program anda. Anda dapat dengan mudah mengaitkan  suatu file database, lalu mengaitkan  data lainnya  untuk memindahkan data dari database ke aplikasi anda dan sebaliknya. Data Control pada suatu database dan menetapkan tabel mana yang akan diambil, lalu mengaitkan  ke pengendali Data Control, menetapkan  field yang akan ditampilkan. Pada waktu itu aplikasi anda dapat mengambil, menampilkan, memperbaharui dan membuat database merekam. Alir data di dalam skenario ini ditandai pada gambar.

Tag Technorati: {grup-tag},

Thursday, November 25, 2010

Trik Mengatur Kemunculan Widget

Ingin mengatur kemunculan widget atau menapilkannya widget dihalaman tertentu pada blog Anda, ikutilah langkah - langkah dibawah ini :

menampilkan widget hanya di Sub halaman / Halaman berikutnya :
<b:widget id='HTML1' locked='false' title='Other Artikel' type='HTML'>
<b:includable id='main'>

<b:if cond='data:blog.pageType == &quot;item&quot;'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != &quot;&quot;'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>

</b:if>
</b:includable>
</b:widget>
</b:section>
</div>


menampilkan widget hanya di halaman Utama :
<b:widget id='HTML1' locked='false' title='Other Artikel' type='HTML'>
<b:includable id='main'>

<b:if cond='data:blog.url == data:blog.homepageUrl'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != &quot;&quot;'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>

</b:if>
</b:includable>
</b:widget>
</b:section>
</div>
menampilkan widget hanya di halaman Tertentu :
<b:widget id='HTML1' locked='false' title='Other Artikel' type='HTML'>
<b:includable id='main'>

<b:if cond='data:blog.url==
"Alamat_URL_postingan_yang_hanya_ada_
widget_ini"'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != &quot;&quot;'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>

</b:if>
</b:includable>
</b:widget>
</b:section>
</div>
Information Sources panduanblogging

Tag Technorati: {grup-tag},,,,,

PILE DRIVING ANALYZER (PDA) TESTING METHOD PROPOSED FOR PLN PILING PROJECT

The construction of foundation for high-rise buildings and infra-structure buildings such as roads, flyover, tunneling road, boiler, and many other structural buildings need a good control to its construction quality; thus needs a comprehensive testing system which can gives the actual condition for other production piles. One of the most popular foundation systems is the Pile Driving Analyzer (PDA) test which is a nice and simple non-destructive method to predict pile capacity, settlement and load transfer.

INTRODUCTION
Pile testing with Pile Driving Analyzer – PAX model (latest version by PDI Inc. – USA)1 will carry out on concrete driven pile with prepared by to produce some output at the time when pile dynamically loaded such as:
1. Pile axial resistance
2. Pile settlement
3. Pile integrity
4. Energy and load transfer
Many PDA output from one pile testing performs as a big benefit compare to static load test using dead weight; this benefits for example are time schedule, soil behavior, and cost.
Pile axial capacity acquire from wave reflection traveling along the pile and the exist of soil resistance through the side of pile plus the end-bearing resistance at the pile bottom and then recorded with a pair of strain transducer and accelerometer position approximately 1.5 x diameter from pile top.Pile integrity and uniformity is one of PDA output.. All of this problems are common happen to bore pile construction; with the acceleration curve got from PDA test, the location of these anomaly can detected and predicted.Good correlation between dynamic and static test resistance have been admitted; this was proven with the presence of ASTM D-4945-962 as the standard of pile dynamic testing.
PDA TEST EQUIPMENT
1. PDA – PAX
2. (2) Strain transducer to measure the strain occur in test pile
3. (2) Accelerometer to measure the acceleration occur in the test pile
4. Connection cable or wireless box
5. Miscellaneous tools for installing the instrument to test pile.
METHOD OF WORK
The top of test pile shall be in flat and good condition without soft concrete. At two side of test pile with approximately 1.5 Diameter (D) distance from pile head, a pair of strain transducer and accelerometer attached and connected through the connection cable or wireless with bluetooth connection to the PDA-PAX. Testing execute by making an impact to the pile top using a proper hammer which is correlate to 2% of ultimate design of pile capacity. This impact was expected not to harm the pile; thus the stress at pile head shall not over than pile compression strength so the pile shall not break at testing time. This can be controlled by testing engineer by showing the stress occurs on the pile head.
PDA TEST ADVANTAGE.
1. Testing time range about 1-2 hour per test pile.
2. Lower cost compare to static load test
3. Pile behavior can achieve by perform CAPWAP analysis.
4. PDA can be done at location where static load test almost impossible to do such as offshore and inside the building.
image

Tag Technorati: {grup-tag},,,

Monday, November 22, 2010

Pengertian Tentang Skripsi

Menurut Kamus Besar Bahasa Indonesia (KBBI), skripsi diartikan sebagai karangan ilmiah yang diwajibkan sebagai bagian dari persyaratan pendidikan akademis. Buat sebagian mahasiswa, skripsi adalah sesuatu yang lumrah. Tetapi buat sebagian mahasiswa yang lain, skripsi bisa jadi momok yang terus menghantui dan menjadi mimpi buruk. Banyak juga yang berujar "lebih baik sakit gigi daripada bikin skripsi".

Saya juga sering mendapat kiriman pertanyaan tentang bagaimana menyusun skripsi dengan baik dan benar. Ada juga beberapa yang menanyakan masalah teknis tertentu dengan skripsinya. Karena keterbatasan waktu, lebih baik saya jawab saja secara berjamaah di sini. Sekalian supaya bisa disimak oleh audiens yang lain.
Karena target pembacanya cukup luas dan tidak spesifik, maka tulisan ini akan lebih memaparkan tentang konsep dan prinsip dasar. Tulisan ini tidak akan menjelaskan terlalu jauh tentang aspek teknis skripsi/penelitian. Jadi, jangan menanyakan saya soal cara menyiasati internal validity, tips meningkatakan response rate, cara-cara dalam pengujian statistik, bagaimana melakukan interpretasi hasil, dan seterusnya. Itu adalah tugas pembimbing Anda, bukan tugas saya.

Apa itu Skripsi ?


Saya yakin (hampir) semua orang sudah tahu apa itu skripsi. Seperti sudah dituliskan di atas, skripsi adalah salah satu syarat yang harus dipenuhi sebagai bagian untuk mendapatkan gelar sarjana (S1). Skripsi inilah yang juga menjadi salah satu pembeda antara jenjang pendidikan sarjana (S1) dan diploma (D3).
Ada beberapa syarat yang musti dipenuhi sebelum seorang mahasiswa bisa menulis skripsi. Tiap universitas/fakultas memang mempunyai kebijakan tersendiri, tetapi umumnya persyaratan yang harus dipenuhi hampir sama. Misalnya, mahasiswa harus sudah memenuhi sejumlah SKS, tidak boleh ada nilai D atau E, IP Kumulatif semester tersebut minimal 2.00, dan seterusnya. Anda mungkin saat ini belum "berhak" untuk menulis skripsi, akan tetapi tidak ada salahnya untuk mempersiapkan segalanya sejak awal.
Skripsi tersebut akan ditulis dan direvisi hingga mendapat persetujuan dosen pembimbing. Setelah itu, Anda harus mempertahankan skripsi Anda di hadapan penguji dalam ujian skripsi nantinya. Nilai Anda bisa bervariasi, dan terkadang, bisa saja Anda harus mengulang skripsi Anda (tidak lulus).
Skripsi juga berbeda dari tesis (S2) dan disertasi (S3). Untuk disertasi, mahasiswa S3 memang diharuskan untuk menemukan dan menjelaskan teori baru. Sementara untuk tesis, mahasiswa bisa menemukan teori baru atau memverikasi teori yang sudah ada dan menjelaskan dengan teori yang sudah ada. Sementara untuk mahasiswa S1, skripsi adalah "belajar meneliti".
Jadi, skripsi memang perlu disiapkan secara serius. Akan tetapi, juga nggak perlu disikapi sebagai mimpi buruk atau beban yang maha berat.

Miskonsepsi tentang Skripsi

Banyak mahasiswa yang merasa bahwa skripsi hanya "ditujukan" untuk mahasiswa-mahasiswa dengan kecerdasan di atas rata-rata. Menurut saya pribadi, penulisan skripsi adalah kombinasi antara kemauan, kerja keras, dan relationships yang baik. Kesuksesan dalam menulis skripsi tidak selalu sejalan dengan tingkat kepintaran atau tinggi/rendahnya IPK mahasiswa yang bersangkutan. Seringkali terjadi mahasiswa dengan kecerdasan rata-rata air lebih cepat menyelesaikan skripsinya daripada mahasiswa yang di atas rata-rata.
Masalah yang juga sering terjadi adalah seringkali mahasiswa datang berbicara ngalor ngidul dan membawa topik skripsi yang terlalu muluk. Padahal, untuk tataran mahasiswa S1, skripsi sejatinya adalah belajar melakukan penelitian dan menyusun laporan menurut kaidah keilmiahan yang baku. Skripsi bukan untuk menemukan teori baru atau memberikan kontribusi ilmiah. Karenanya, untuk mahasiswa S1 sebenarnya replikasi adalah sudah cukup.
Hal lain yang juga perlu diperhatikan adalah bahwa penelitian, secara umum, terbagi dalam dua pendekatan yang berbeda: pendekatan saintifik dan pendekatan naturalis. Pendekatan saintifik (scientific approach) biasanya mempunyai struktur teori yang jelas, ada pengujian kuantitif (statistik), dan juga menolak grounded theory. Sebaliknya, pendekatan naturalis (naturalist approach) umumnya tidak menggunakan struktur karena bertujuan untuk menemukan teori, hipotesis dijelaskan hanya secara implisit, lebih banyak menggunakan metode eksploratori, dan sejalan dengan grounded theory.
Mana yang lebih baik antara kedua pendekatan tersebut? Sama saja. Pendekatan satu dengan pendekatan lain bersifat saling melengkapi satu sama lain (komplementer). Jadi, tidak perlu minder jika Anda mengacu pada pendekatan yang satu, sementara teman Anda menggunakan pendekatan yang lain. Juga, tidak perlu kuatir jika menggunakan pendekatan tertentu akan menghasilkan nilai yang lebih baik/buruk daripada menggunakan pendekatan yang lain.

Hal-hal yang Perlu Dilakukan

Siapkan Diri. Hal pertama yang wajib dilakukan adalah persiapan dari diri Anda sendiri. Niatkan kepada Tuhan bahwa Anda ingin menulis skripsi. Persiapkan segalanya dengan baik. Lakukan dengan penuh kesungguhan dan harus ada kesediaan untuk menghadapi tantangan/hambatan seberat apapun.
Minta Doa Restu. Saya percaya bahwa doa restu orang tua adalah tiada duanya. Kalau Anda tinggal bersama orang tua, mintalah pengertian kepada mereka dan anggota keluarga lainnya bahwa selama beberapa waktu ke depan Anda akan konsentrasi untuk menulis skripsi. Kalau Anda tinggal di kos, minta pengertian dengan teman-teman lain. Jangan lupa juga untuk membuat komitmen dengan pacar. Berantem dengan pacar (walau sepele) bisa menjatuhkan semangat untuk menyelesaikan skripsi.
Buat Time Table. Ini penting agar penulisan skripsi tidak telalu time-consuming. Buat planning yang jelas mengenai kapan Anda mencari referensi, kapan Anda harus mendapatkan judul, kapan Anda melakukan bimbingan/konsultasi, juga target waktu kapan skripsi harus sudah benar-benar selesai.
Berdayakan Internet. Internet memang membuat kita lebih produktif. Manfaatkan untuk mencari referensi secara cepat dan tepat untuk mendukung skripsi Anda. Bahan-bahan aktual bisa ditemukan lewat Google Scholar atau melalui provider-provider komersial seperti EBSCO atau ProQuest.
Jadilah Proaktif. Dosen pembimbing memang "bertugas" membimbing Anda. Akan tetapi, Anda tidak selalu bisa menggantungkan segalanya pada dosen pembimbing. Selalu bersikaplah proaktif. Mulai dari mencari topik, mengumpulkan bahan, "mengejar" untuk bimbingan, dan seterusnya.
Be Flexible. Skripsi mempunyai tingkat "ketidakpastian" tinggi. Bisa saja skripsi anda sudah setengah jalan tetapi dosen pembimbing meminta Anda untuk mengganti topik. Tidak jarang dosen Anda tiba-tiba membatalkan janji untuk bimbingan pada waktu yang sudah disepakati sebelumnya. Terkadang Anda merasa bahwa kesimpulan/penelitian Anda sudah benar, tetapi dosen Anda merasa sebaliknya. Jadi, tetaplah fleksibel dan tidak usah merasa sakit hati dengan hal-hal yang demikian itu.
Jujur. Sebaiknya jangan menggunakan jasa "pihak ketiga" yang akan membantu membuatkan skripsi untuk Anda atau menolong dalam mengolah data. Skripsi adalah buah tangan Anda sendiri. Kalau dalam perjalanannya Anda benar-benar tidak tahu atau menghadapi kesulitan besar, sampaikan saja kepada dosen pembimbing Anda. Kalau disampaikan dengan tulus, pastilah dengan senang hati ia akan membantu Anda.
Siapkan Duit. Skripsi jelas menghabiskan dana yang cukup lumayan (dengan asumsi tidak ada sponsorships). Mulai dari akses internet, biaya cetak mencetak, ongkos kirim kuesioner, ongkos untuk membeli suvenir bagi responden penelitian, biaya transportasi menuju tempat responden, dan sebagainya. Jangan sampai penulisan skripsi macet hanya karena kehabisan dana. Ironis kan?

Tahap-tahap Persiapan

Kalau Anda beruntung, bisa saja dosen pembimbing sudah memiliki topik dan menawarkan judul skripsi ke Anda. Biasanya, dalam hal ini dosen pembimbing sedang terlibat dalam proyek penelitian dan Anda akan "ditarik" masuk ke dalamnya. Kalau sudah begini, penulisan skripsi jauh lebih mudah dan (dijamin) lancar karena segalanya akan dibantu dan disiapkan oleh dosen pembimbing.
Sayangnya, kebanyakan mahasiswa tidak memiliki keberuntungan semacam itu. Mayoritas mahasiswa, seperti ditulis sebelumnya, harus bersikap proaktif sedari awal. Jadi, persiapan sedari awal adalah sesuatu yang mutlak diperlukan.
Idealnya, skripsi disiapkan satu-dua semester sebelum waktu terjadwal. Satu semester tersebut bisa dilakukan untuk mencari referensi, mengumpulkan bahan, memilih topik dan alternatif topik, hingga menyusun proposal dan melakukan bimbingan informal.
Dalam mencari referensi/bahan acuan, pilih jurnal/paper yang mengandung unsur kekinian dan diterbitkan oleh jurnal yang terakreditasi. Jurnal-jurnal top berbahasa asing juga bisa menjadi pilihan. Kalau Anda mereplikasi jurnal/paper yang berkelas, maka bisa dipastikan skripsi Anda pun akan cukup berkualitas.
Unsur kekinian juga perlu diperhatikan. Pertama, topik-topik baru lebih disukai dan lebih menarik, bahkan bagi dosen pembimbing/penguji. Kalau Anda mereplikasi topik-topik lawas, penguji biasanya sudah "hafal di luar kepala" sehingga akan sangat mudah untuk menjatuhkan Anda pada ujian skripsi nantinya.
Kedua, jurnal/paper yang terbit dalam waktu 10 tahun terakhir, biasanya mengacu pada referensi yang terbit 5-10 tahun sebelumnya. Percayalah bahwa mencari dan menelusur referensi yang terbit tahun sepuluh-dua puluh tahun terakhir jauh lebih mudah daripada melacak referensi yang bertahun 1970-1980.
Salah satu tahap persiapan yang penting adalah penulisan proposal. Tentu saja proposal tidak selalu harus ditulis secara "baku". Bisa saja ditulis secara garis besar (pointer) saja untuk direvisi kemudian. Proposal ini akan menjadi guidance Anda selama penulisan skripsi agar tidak terlalu keluar jalur nantinya. Proposal juga bisa menjadi alat bantu yang akan digunakan ketika Anda mengajukan topik/judul kepada dosen pembimbing Anda. Proposal yang bagus bisa menjadi indikator yang baik bahwa Anda adalah mahasiswa yang serius dan benar-benar berkomitmen untuk menyelesaikan skripsi dengan baik.

Kiat Memilih Dosen Pembimbing

Dosen pembimbing (academic advisor) adalah vital karena nasib Anda benar-benar berada di tangannya. Memang benar bahwa dosen pembimbing bertugas mendampingi Anda selama penulisan skripsi. Akan tetapi, pada prakteknya ada dosen pembimbing yang "benar-benar membimbing" skripsi Anda dengan intens. Ada pula yang membimbing Anda dengan "melepas" dan memberi Anda kebebasan. Mempelajari dan menyesuaikan diri dengan dosen pembimbing adalah salah satu elemen penting yang mendukung kesuksesan Anda dalam menyusun skripsi.
Tiap universitas/fakultas mempunyai kebijakan tersendiri soal dosen pembimbing ini. Anda bisa memilih sendiri dosen pembimbing yang Anda inginkan. Tapi ada juga universitas/fakultas yang memilihkan dosen pembimbing buat Anda. Tentu saja lebih "enak" kalau Anda bisa memilih sendiri dosen pembimbing untuk skripsi Anda.
Lalu, bagaimana memilih dosen pembimbing yang benar-benar tepat?
Secara garis besar, dosen bisa dikategorikan sebagai: (1) dosen senior, dan (2) dosen junior. Dosen senior umumnya berusia di atas 40-an tahun, setidaknya bergelar doktor (atau professor), dengan jam terbang yang cukup tinggi. Sebaliknya, dosen junior biasanya berusia di bawah 40 tahun, umumnya masih bergelar master, dan masih gampang dijumpai di lingkungan kampus.
Tentu saja, masing-masing memiliki kelebihan dan kekurangan masing-masing. Sebagai contoh, kalau Anda memilih dosen pembimbing senior, biasanya Anda akan mengalami kesulitan sebagai berikut:
  • Proses bimbingan cukup sulit, karena umumnya dosen senior sangat perfeksionis.
  • Anda akan kesulitan untuk bertemu muka karena umumnya dosen senior memiliki jam terbang tinggi dan jadwal yang sangat padat. Tapi, keuntungannya:
  • Kualitas skripsi Anda, secara umum, akan lebih memukau daripada rekan Anda.
  • Anda akan "tertolong" saat ujian skripsi/pendadaran, karena dosen penguji lain (yang kemungkinan masih junior/baru bergelar master) akan merasa sungkan untuk "membantai" Anda.
  • Dalam beberapa kasus, bisa dipastikan Anda akan mendapat nilai A.
Sebaliknya, kalau Anda memilih dosen pembimbing junior, maka Anda akan lebih mudah selama proses bimbingan. Dosen Anda akan mudah dijumpai di lingkungan kampus karena jam terbangnya belum terlalu tinggi. Dosen muda umumnya juga tidak "jaim" dan "sok" kepada mahasiswanya.
Tapi, kerugiannya, Anda akan benar-benar "sendirian" ketika menghadapi ujian skripsi. Kalau dosen penguji lain lebih senior daripada dosen pembimbing Anda, bisa dipastikan Anda akan "dihajar" cukup telak. Dan dosen pembimbing Anda tidak berada dalam posisi yang bisa membantu/membela Anda.
Jadi, hati-hati juga dalam memilih dosen pembimbing.

Format Skripsi yang Benar

Biasanya, setiap fakultas/universitas sudah menerbitkan acuan/pedoman penulisan hasil penelitian yang baku. Mulai dari penyusunan konten, tebal halaman, jenis kertas dan sampul, hingga ukuran/jenis huruf dan spasi yang digunakan. Akan tetapi, secara umum format hasil penelitian dibagi ke dalam beberapa bagian sebagai berikut.
Pendahuluan. Bagian pertama ini menjelaskan tentang isu penelitian, motivasi yang melandasi penelitian tersebut dilakukan, tujuan yang diharapkan dapat tercapai melalui penelitian ini, dan kontribusi yang akan diberikan dari penelitian ini.
Pengkajian Teori & Pengembangan Hipotesis. Setelah latar belakang penelitian dipaparkan jelas di bab pertama, kemudian dilanjutkan dengan kaji teori dan pengembangan hipotesis. Pastikan bahwa bagian ini align juga dengan bagian sebelumnya. Mengingat banyak juga mahasiswa yang "gagal" menyusun alignment ini. Akibatnya, skripsinya terasa kurang make sense dan nggak nyambung.
Metodologi Penelitian. Berisi penjelasan tentang data yang digunakan, pemodelan empiris yang dipakai, tipe dan rancangan sampel, bagaimana menyeleksi data dan karakter data yang digunakan, model penelitian yang diacu, dan sebagainya.
Hasil Penelitian. Bagian ini memaparkan hasil pengujian hipotesis, biasanya meliputi hasil pengolahan secara statistik, pengujian validitas dan reliabilitas, dan diterima/tidaknya hipotesis yang diajukan.
Penutup. Berisi ringkasan, simpulan, diskusi, keterbatasan, dan saran. Hasil penelitian harus disarikan dan didiskusikan mengapa hasil yang diperoleh begini dan begitu. Anda juga harus menyimpulkan keberhasilan tujuan riset yang dapat dicapai, manakah hipotesis yang didukung/ditolak, keterbatasan apa saja yang mengganggu, juga saran-saran untuk penelitian mendatang akibat dari keterbatasan yang dijumpai pada penelitian ini.
Jangan lupa untuk melakukan proof-reading dan peer-review. Proof-reading dilakukan untuk memastikan tidak ada kesalahan tulis (typo) maupun ketidaksesuaian tata letak penulisan skripsi. Peer-review dilakukan untuk mendapatkan second opinion dari pihak lain yang kompeten. Bisa melalui dosen yang Anda kenal baik (meski bukan dosen pembimbing Anda), kakak kelas/senior Anda, teman-teman Anda yang dirasa kompeten, atau keluarga/orang tua (apabila latar belakang pendidikannya serupa dengan Anda).

Beberapa Kesalahan Pemula

Ketidakjelasan Isu. Isu adalah titik awal sebelum melakukan penelitian. Isu seharusnya singkat, jelas, padat, dan mudah dipahami. Isu harus menjelaskan tentang permasalahan, peluang, dan fenomena yang diuji. Faktanya, banyak mahasiswa yang menuliskan isu (atau latar belakang) berlembar-lembar, tetapi sama sekali sulit untuk dipahami.
Tujuan Riset & Tujuan Periset. Tidak jarang mahasiswa menulis "sebagai salah satu syarat untuk mencapai gelar kesarjanaan" sebagai tujuan risetnya. Hal ini adalah kesalahan fatal. Tujuan riset adalah menguji, mengobservasi, atau meneliti fenomena dan permasalahan yang terjadi, bukan untuk mendapatkan gelar S1.
Bab I: Bagian Terpenting. Banyak mahasiswa yang mengira bahwa bagian terpenting dari sebuah skripsi adalah bagian pengujian hipotesis. Banyak yang menderita sindrom ketakutan jika nantinya hipotesis yang diajukan ternyata salah atau ditolak. Padahal, menurut saya, bagian terpenting skripsi adalah Bab I. Logikanya, kalau isu, motivasi, tujuan, dan kontribusi riset bisa dijelaskan secara runtut, biasanya bab-bab berikutnya akan mengikuti dengan sendirinya. (baca juga: Joint Hypotheses)
Padding. Ini adalah fenomena yang sangat sering terjadi. Banyak mahasiswa yang menuliskan terlalu banyak sumber acuan dalam daftar pustaka, walaupun sebenarnya mahasiswa yang bersangkutan hanya menggunakan satu-dua sumber saja. Sebaliknya, banyak juga mahasiswa yang menggunakan beragam acuan dalam skripsinya, tetapi ketika ditelusur ternyata tidak ditemukan dalam daftar acuan.
Joint Hypotheses. Menurut pendekatan saintifik, pengujian hipotesis adalah kombinasi antara fenomena yang diuji dan metode yang digunakan. Dalam melakukan penelitian ingatlah selalu bahwa fenomena yang diuji adalah sesuatu yang menarik dan memungkinkan untuk diuji. Begitu pula dengan metode yang digunakan, haruslah metode yang valid dan dapat dipertanggungjawabkan secara ilmiah. Kalau keduanya terpenuhi, yakinlah bahwa skripsi Anda akan outstanding. Sebaliknya, kalau Anda gagal memenuhi salah satu (atau keduanya), bersiaplah untuk dibantai dan dicecar habis-habisan.
Keterbatasan & Kemalasan. Mahasiswa sering tidak bisa membedakan antara keterbatasan riset dan "kemalasan riset". Keterbatasan adalah sesuatu hal yang terpaksa tidak dapat terpenuhi (atau tidak dapat dilakukan) karena situasi dan kondisi yang ada. Bukan karena kemalasan periset, ketiadaan dana, atau sempitnya waktu.
Kontribusi Riset. Ini penting (terutama) jika penelitian Anda ditujukan untuk menarik sponsor atau dibiayai dengan dana pihak sponsor. Kontribusi riset selayaknya dijelaskan dengan lugas dan gamblang, termasuk pihak mana saja yang akan mendapatkan manfaat dari penelitian ini, apa korelasinya dengan penelitian yang sedang dilakukan, dan seterusnya. Kegagalan dalam menjelaskan kontribusi riset akan berujung pada kegagalan mendapatkan dana sponsor.

Menghadapi Ujian Skripsi

Benar. Banyak mahasiswa yang benar-benar takut menghadapi ujian skripsi (oral examination). Terlebih lagi, banyak mahasiswa terpilih yang jenius tetapi ternyata gagal dalam menghadapi ujian pendadaran. Di dalam ruang ujian sendiri tidak jarang mahasiswa mengalami ketakutan, grogi, gemetar, berkeringat, yang pada akhirnya menggagalkan ujian yang harus dihadapi.
Setelah menulis skripsi, Anda memang harus mempertahankannya di hadapan dewan penguji. Biasanya dewan penguji terdiri dari satu ketua penguji dan beberapa anggota penguji. Lulus tidaknya Anda dan berapa nilai yang akan Anda peroleh adalah akumulasi dari skor yang diberikan oleh masing-masing penguji. Tiap penguji secara bergantian (terkadang juga keroyokan) akan menanyai Anda tentang skripsi yang sudah Anda buat. Waktu yang diberikan biasanya berkisar antara 30 menit hingga 1 jam.
Ujian skripsi kadang diikuti juga dengan ujian komprehensif yang akan menguji sejauh mana pemahaman Anda akan bidang yang selama ini Anda pelajari. Tentu saja tidak semua mata kuliah diujikan, melainkan hanya mata kuliah inti (core courses) saja dengan beberapa pertanyaan yang spesifik, baik konseptual maupun teknis.
Grogi, cemas, kuatir itu wajar dan manusiawi. Akan tetapi, ujian skripsi sebaiknya tidak perlu disikapi sebagai sesuatu yang terlalu menakutkan. Ujian skripsi adalah "konfirmasi" atas apa yang sudah Anda lakukan. Kalau Anda melakukan sendiri penelitian Anda, tahu betul apa yang Anda lakukan, dan tidak grogi di ruang ujian, bisa dipastikan Anda akan perform well.
Cara terbaik untuk menghadapi ujian skripsi adalah Anda harus tahu betul apa yang Anda lakukan dan apa yang Anda teliti. Siapkan untuk melakukan presentasi. Akan tetapi, tidak perlu Anda paparkan semuanya secara lengkap. Buatlah "lubang jebakan" agar penguji nantinya akan menanyakan pada titik tersebut. Tentu saja, Anda harus siapkan jawabannya dengan baik. Dengan begitu Anda akan tampak outstanding di hadapan dewan penguji.
Juga, ada baiknya beberapa malam sebelum ujian, digiatkan untuk berdoa atau menjalankan sholat tahajud di malam hari. Klise memang. Tapi benar-benar sangat membantu.
Jujur saja, saya (dulu) menyelesaikan skripsi dalam tempo 4 minggu tanpa ada kendala dan kesulitan yang berarti. Dosen pembimbing saya adalah seorang professor dengan jam terbang sangat tinggi. Selama berada dalam ruang ujian, kami lebih banyak berbicara santai sembari sesekali tertawa. Dan Alhamdulillah saya mendapat nilai A.
Bukan. Bukan saya bermaksud sombong, tetapi hanya untuk memotivasi Anda. Kalau saya bisa, seharusnya Anda sekalian pun bisa.

Pasca Ujian Skripsi

Banyak yang mengira, setelah ujian skripsi segalanya selesai. Tinggal revisi, bawa ke tukang jilid/fotokopi, urus administrasi, daftar wisuda, lalu traktir makan teman-teman. Memang benar. Setelah Anda dinyatakan lulus ujian skripsi, Anda sudah berhak menyandang gelar sarjana yang selama ini Anda inginkan.
Faktanya, lulus ujian skripsi saja sebenarnya belum terlalu cukup. Sebenarnya Anda bisa melakukan lebih jauh lagi dengan skripsi Anda. Caranya?
Cara paling gampang adalah memodifikasi dan memperbaiki skripsi Anda untuk kemudian dikirimkan pada media/jurnal publikasi. Cara lain, kalau Anda memang ingin serius terjun di dunia ilmiah, lanjutkan dan kembangkan saja penelitian/skripsi Anda untuk jenjang S2 atau S3. Dengan demikian, kelak akan semakin banyak penelitian dan publikasi yang mudah-mudahan bisa memberi manfaat bagi bangsa ini.

Sunday, November 21, 2010

Build an Excel Add-In

Build an Excel Add-In



About Add-Ins
An Excel Add-In is a file (usually with an .xla or .xll extension) that Excel can load when it starts up. The file contains code (VBA in the case of an .xla Add-In) that adds additional functionality to Excel, usually in the form of new functions
Add-Ins provide an excellent way of increasing the power of Excel and they are the ideal vehicle for distributing your custom functions. Excel is shipped with a variety of Add-Ins ready for you to load and start using, and many third-party Add-Ins are available
This article shows you how to write a custom function using Excel VBA and how to save and install it as an Add-In. Custom functions are often referred to as UDFs (User Defined Functions. If you have never built a UDF before, this is a good place to start, or you might like to take a look at the tutorial Writing Your First VBA Function in Excel which demonstrates the process in detail with some more examples.
In the Excel tutorial Working Out a Person's Age - An Introduction to Nested IF Statements I showed how to use IF statements to calculate someone's age from their date of birth. Surprisingly, Excel does not have a built-in function for this commonly-required calculation so it is an ideal candidate for a custom function.
If you are already comfortable with writing custom functions, you can go straight to the section explaining how to save your UDFs as an Add-In.

Write the Function
An Add-In can contain as many UDFs as you want, and you can add more later simply by opening and editing the Add-In file.
 
Step 1: Add a Code Module to a New Workbook
Start Excel or, if you already have Excel open, create a new empty workbook
Open the Visual Basic Editor from Tools > Macro > Visual Basic Editor (Keys: ALT+F11). This selects the empty workbook.
If you were already working in Excel the name might be different - check the name in the title bar of the Excel window if you aren't sure. If the Project Explorer is not visible open it by going to View > Project Explorer .
From the Insert menu choose Module. Dari menu Insert pilih Modul. This adds a new empty code module to the selected workbook. You will also see the module appear in the Project Explorer pane.
Step 2: Enter the Code
In the code window type the line…
 
Function Age(DoB As Date)
 
...and press ENTER. The VB editor automatically enters the line "End Function" and places your cursor in the empty space between them.
Typing "Function" defines the code that follows as a function, as opposed to a macro or subroutine, which is denoted by the word "Sub".
Next is the function's name, which can be anything you like. Spaces aren't allowed so separate words with underscores (eg Age_in_years) or, preferably, with capitals (eg AgeInYears).
A function usually needs one or more "arguments". These are entered in brackets after the function name. An argument is a piece of information that the function uses to perform its calculation. When declaring the arguments it is good practice to specify the data type. In this case only one argument is needed, the date of birth that will be used to calculate the person's age. For simplicity, I have called this argument "DoB". Arguments work like variables in macros. When you type the word "As" after the argument's name the VB editor presents you with a list of possible entries. You can type or pick from the list.
Between the Function and End Function statements, press TAB (to indent your code for clarity) and type the line...
Age = Int((Date - DoB) / 365.25)
This tells Excel how to work out the function. It uses two built-in functions, INT (which makes a whole number - or integer - out of the result) and DATE (a visual basic function equivalent to Excel's TODAY() function that returns the current date).
The statement effectively reads... "Take today's date and subtract from it the supplied date of birth. Divide the result by 365.25 and show the answer as a whole number by rounding down."
The finished function should look like this:

Function Age(DoB As Date )
Age = Int((Date - DoB) / 365.25)
End Function
Step 3: Test the Function
You can try out the function right away. Switch to Excel and in your empty workbook (the same one that you are using to create the function's code module) enter a date into a cell. In another cell enter your function in the same way as you would use one of Excel's built-in functions, eg =Age(A1)
A UDF is available to all open workbooks whenever its host workbook (the workbook containing the UDF's code module) is open. However, if you try to use the function in a different workbook you can encounter a problem...
The other workbook can't find the function so the #NAME? error appears. To avoid this happening you could add the host workbook's name to the function to tell Excel where to find it...
  
This works but is very clumsy and demonstrates one of the reasons why the best place for your custom functions is inside an Excel Add-In (with some exceptions... see note below .)
 
Adding Features to the Function
Allowing for the Absence of Data
A disadvantage of many functions is that when you prepare a worksheet in advance of its receiving data (eg in a template where you want the functions to be in place ready to calculate the user's input) the functions try to calculate on empty cells, often producing errors or nonsense results. If our Age function tries to calculate an empty cell it still produces a result, in this case 102 (the current year being 2002). This happens because it takes the value of the empty cell to be zero, and interprets day zero as January 0 1900 . This is logical to Excel because the first day it knows about is day 1, which is January 1 1900.
Normally you would try to anticipate this by entering your age function as part of an IF statement eg =IF(ISBLANK(A1),"",age(A1)) The IF statement tells Excel to enter a value of "nothing" (represented by "" ) if the data cell is blank but to calculate the Age function if it contains a value...  
This works fine, but you can save yourself the trouble by incorporating this sort of troubleshooting into the code of the function itself.
Modify the function code as follows:

Function Age(DoB As Date )

If DoB = 0
Age = ""
Else
Lain
Age = Int((Date - DoB) / 365.25)
End If


End Function
Alternatively a custom error message could be included by replacing the pair of quote marks in code line 3 with a message in quotes eg Age = "No Birthdate" . The result would be...

Making the Function More Accurate
The calculation used in the example above is very accurate, but not completely accurate. It works on the principle that there is an average of 365.25 days in a year (usually 365 but 366 every fourth year) so dividing a person's age in days by 365.25 should give their age in years.
This works fine most of the time but it can (rarely) throw up an error. If the person in question has their birthday today and were born on a year that is a multiple of 4 years ago, the calculation will be a year out. A small possibility, but if we're going to do it we might as well do it right!
In my tutorial Working Out a Person's Age - An Introduction to Nested IF Statements I showed how to use IF statements in Excel to calculate someone's age from their date of birth, with complete accuracy. I could do the same in VBA for my custom function (although the syntax of a VBA IF statement is slightly different to that in Excel) but I prefer to use a CASE statement. Excel doesn't have the CASE statement but VBA does. I find CASE statements easier than IF statements to figure out when the logic is slightly complex.
Here is the code for my improved function:

Function Age(DoB As Date )

If DoB = 0 Then
Age = "No Birthdate"
Else

Select Case Month(Date)

Case Is < Month(DoB)
Age = Year(Date) - Year(DoB) - 1
Case Is = Month(DoB)

If Day(Date) >= Day(DoB) Then
Age = Year(Date) - Year(DoB)
Else
Age = Year(Date) - Year(DoB) – 1
End If

Case Is > Month(DoB)
Age = Year(Date) - Year(DoB)
End Select

End If


End Function
TIP: Select the lines of code in the grey box above, copy them (Keys: CTRL+C) and paste them directly into your VBA code window (Keys: CTRL+V).
How the code works...
Function Age(DoB As Date ) Gives a name to the function and declares that a single argument is needed, which must be a date.
If DoB = 0 Then
Age = "No Birthdate"
An IF statement to determine whether there is a value in the data cell. The value of an empty cell is read as zero. If that is true then the function returns the text "No Birthdate".
Else
Select Case Month(Date)
If the data cell is not empty, consider the month that it is today...
Case Is < Month(DoB)
Age = Year(Date) - Year(DoB) - 1
If today's month is before (ie less than) the month of the person's date of birth, they have not had their birthday, so their age is this year minus their birth year minus 1.
Case Is = Month(DoB) If today's month is the same as the month of the person's date of birth we need to know whether or not they have had their birthday yet so...
If Day(Date) >= Day(DoB) Then

Age = Year(Date) - Year(DoB)
If the today is equal to or past the day of their birthday, then they have had their birthday (or it is today) so their age is this year minus their birth year...
Else

Age = Year(Date) - Year(DoB) - 1
End If
...otherwise, they have not had their birthday so their age is this year minus their birth year minus 1. ...
Case Is > Month(DoB)
Age = Year(Date) - Year(DoB)
If today's month is after (ie greater than) the month of the person's date of birth, they have had their birthday, so their age is this year minus their birth year.
End Select
End If
End Function
Closes the CASE statement, the IF statement and the Function.
This calculation may seem rather complex but you only have to type it once! When you have created your function all you ever have to type is its name.

Creating an Excel Add-In

Step 1: Adding a Description to the Function
When a function is inserted via the function wizard (ie the Paste Function tool) the user sees a description of the function that helps them choose the correct one. This isn't the case with custom functions [click the thumbnail below to see a full-sized image]...
If you want a description you have to add it yourself.
Go to Tools > Macro > Macros to open the Macro dialog box. You will see all available macros listed but no custom functions. In the Macro name: text box type the name of the function you want to describe...  
Click the [Options] button to open the Macro Options dialog box. (If the Options button is greyed out the function name you entered has not been recognised. Check your typing.)
Type a description for your function in the Description: text box.. 
Click [OK] to close the Macro Options dialog and then click [Cancel] to close the Macro dialog. The description has now been assigned to the function. You can repeat the procedure to amend the description if required. This description is now shown when the custom function is selected in the Function Wizard [click the thumbnail below to see a full-sized image]...

Step 2: Save the Workbook as an Add-In
The workbook containing your code module now has to be saved as an Excel Add-In (*.xla) file.
In the Excel window go to File > Save to open the Save As dialog. Enter a name for your Add-In file (the usual file naming rules apply) and use the Save as type: option to change the file type to Microsoft Excel Add-In (*.xla) .  
Before clicking [OK] check the location in which you are saving the Add-In file. This will vary depending upon your particular set-up. On my computers the locations are:

Excel XP(2002) on Windows XP:

C:\Documents and Settings\UserName\Application Data\Microsoft\AddIns

Excel 2000 on Windows 98:
C:\Windows\Application Data\Microsoft\AddIns

Excel 97 on Windows 98:
C:\Program Files\Microsoft Office\Office\Library

You can store your Add-In anywhere you like but, if you want it to be listed along with the built-in ones, you should save it into the correct location. Excel XP and Excel 2000 will automatically take you to the correct folder but Excel 97 does not.

TIP: To check the save location, first set the Save as type: to Microsoft Excel Add-In then open the Save in: drop-down list to reveal the path to the save folder.
You can now close the original workbook (Book 1). You do not need to save the changes if prompted.

Step 3: Add a Description to the Add-In
It is a good idea to add a description to the Add-In itself. This description will be displayed in the Add-Ins dialog box when you choose an Add-In to install.
First, use the file manager to locate your Add-In file. Right-click on the file icon and choose Properties from the context menu. In the file properties dialog click the Summary tab. Type a description of your Add-In in the Comments: text box. If you wish you can also type a name for your Add-In in the Title: text box. This is useful if you have chosen a short or cryptic name for your *.xla file but would like to show a more descriptive name in the Add-Ins dialog. I could give my Add-In file the filename mgfunctions.xla but assign it the title Martin's Functions .
Finally click [OK] to accept your changes. You Add-In is now ready for installation, and can be distributed to other users if required.

Step 4: Install the Add-In
If Excel has not been shut down since you created your Add-In (or since one was copied to the computer's hard disk) restart Excel to make sure that it refreshes its list of available Add-Ins.

Go to Tools > Add-Ins to open the Add-Ins dialog. If you have stored your Add-In in the default location you will see its name displayed in the Add-Ins available: window (if you have stored your Add-In in a different folder, use the [Browse] button to find it). Click on your Add-In's name to see its description at the bottom of the dialog box.
To install your Add-In place a tick in the check-box next to your Add-In's name and click [OK] . [Click the thumbnail below to see a full-sized image]...
As soon as the Add-In is installed its functions will be available in Excel. Find them in the User Defined section of the Function Wizard (Paste Function Tool) or simply type them into a cell as you would any built-in function. The Add-In will remain installed until you return to the Add-Ins dialog and uninstall it by removing the tick from the check-box.

Making Additions and Changes to an Add-In

Your Add-In file can contain as many modules and custom functions as you want. You can add them at any time.
If your Add-In is installed you will see it listed in the Project Explorer pane of the VB editor. Locate the module containing your functions and make whatever additions and changes you want. If your Add-In is not installed, find the Add-In file and double-click it to open it in Excel. You will not be able to see it in the Excel window but it will appear in the VB editor's Project Explorer.
Remember to save your changes! Do this from the VB editor window with File > Save [click the thumbnail below to see the full sized image]...

Adding Comments to Your Code

It's easy to add notes (properly called "comments") to your VBA code. Enter an apostrophe (ie single quote mark) and then type. The apostrophe tells the code compiler to ignore everything that follows it on the same line so it isn't treated as executable code and the compiler doesn't try to run it. Anything you type after the apostrophe is "commented out" and is coloured green in the VB editor's code window...  
You can use this technique to add explanatory notes to your code (ever returned to some code you wrote a while ago and wondered what on earth it means?).
You can also temporarily comment out lines of code so that they don't run - useful for testing your code. If you think you don't need a line of code, don't delete it but comment it out first. Then test your code to see if it still works. If everything is OK you can now delete the line. If your code fails, simply remove the apostrophe and your line of code is restored.

Password Protecting Your Code

VBA allows you to password-protect your code, whether it is the macro code behind a regular workbook or the code modules of an Add-In. Password-protecting code prevents unauthorised viewing of your code for purposes of security or copyright.
To password-protect your Add-In locate it in the VB Editor. Right-click its name in the Project Explorer pane and choose VBAProject Properties... from the context menu. In the VBAProject - Project Properties dialog click the Protection tab.
Place a tick in the Lock project for viewing check box, then enter and confirm your password. Click [OK] and go to File > Save to save your changes. [Click the thumbnail below to see the full-sized image]...
The password-protection will take effect from the next time Excel is opened. Any attempt to view the Add-In's code module will result in a request for the password...

Assigning Add-In Macros to Custom Toolbar Buttons and Menu Items

Add-Ins aren't just for containing functions. They may contain useful macros. You may want to assign a macro that is contained in an Add-In to a custom toolbar button or custom menu item.
Normally to do this you would right-click on your new button or menu item and choose Assign Macro and pick your macro from the list provided. However, the names of macros contained in Add-Ins are not shown in the list. Don't worry! Just type the name of the macro in the Macro Name: box at the top of the dialog. Excel will find it and the macro will run as expected when the button is clicked or the menu item chosen.

A Final Word of Caution!

A custom function that is located in a code module within a workbook will go wherever the workbook goes. In other words if you open the workbook file on a different machine, or e-mail it to someone else, the function travels with the workbook and will always be available.
If your workbook refers to a custom function contained in an Add-In, the workbook will only be able to calculate the function when the Add-In is present. If you mail the workbook to someone else you will have to mail them the Add-In too!
If you want to use custom functions contained in an Add-In in a the code of another workbook, you will have to set a reference to the Add-In. Read the article How to Use Your Excel Add-In Functions in VBA for details.