Posts tagged ‘VBA’
Custom Function untuk Excel
Berikut adalah contoh custom function untuk excel.
untuk melihat semua fungsi dan contoh pemakaiannya download file excel custom function di sini :
Fungsi terdiri dari :
eBook on Ms Office VBA
Advancing Your Office 2007 Power: Using Visual Basic
By Greg Perry
You can automate many routine tasks that you perform with Office 2007’s products by recording your keystrokes and storing them in a macro. You can easily assign the macro to a keystroke such as Ctrl+Shift+F12 and Word or Excel will zip through your automated commands the moment you press the keys.
Recorded macro keystrokes have been around for years and many Office users are familiar with them. The only drawback is they are simple and don’t go the extra mile when you want something really automated. Read more on Office2007withVisualBasic.pdf size : 206.65 KB
FUNGSI EXCEL HITUNG KATA
Kadang kita perlu mengetahui berapa jumlah kata yang kita tulis dalam Workbooks atau Worksheet Ms Excel. Dalam Excel tidak ada fungsi khusus yang dapat digunakan untuk menghitung jumlah kata. Oleh karena itu perlu dibuat fungsi untuk menghitung kata dengan menggunakan VBA. However, you can count the number of words with a simple VBA macro.
Sub Procedure di bawah ini akan menghitung berapa jumlah kata yang ada di dalam ActiveSheet (sheet yang aktif) dan menampilkannya dalam Kotak Pesan (Message Box). Contoh file dapat di download adalah (Download file : hitung-kata.zip)
Gambar di Form Access
Menjawab pertanyaan Puji Astuti – tentang: Posting Menampilkan Gambar Pada Form
Menampilkan Gambar/Foto/Image/Picture tanpa harus menyimpan dalam file database maka berikut saya lampirkan file TampilGambar.ZIP
Silahkan dibuka karena sumbernya dari mana-mana yang jelas Microsoft juga membahas hal ini di
ACC: How to Display Images in a Form or in a Report Without Storing the Images in a Table
Berikut cuplikan dari Microsoft Access Help dan Support: “Sometimes it is not practical to store images in a Microsoft Access table. If you have a large number of images, or if each of your image files is large, the size of the Microsoft Access database file can rapidly increase. The following examples show you how to display Windows bitmap images on a Microsoft Access form and on a report without storing the images in a Microsoft Access table.”Dan beberapa pakar Access juga membahas salah satunya Microsoft® Access Software & Utilities –Handling Images with Microsoft® Access
Jadi ada tiga macam cara mengelola gambar di Access yaitu:
1. Simpan sebagai gambar di OLE Field – Store the image in an OLE field and use a bound object frame to display the image.
2. Simpan alamat path/dir dalam text field yang dapat digunakan sbg control image – Store the path to the image in a text field, using an image control to display the image.
3. Simpan sebagai BLOB dalam OLE Field – Store the image as a binary large object bitmap (BLOB) in an OLE field, extract the image when required and use an image control to display the image.
Font Blinking di Excel
Excel tidak punya fitur untuk membuat teks berkedip. (catatan: blinking teks sangat mengganggu orang yang membaca pesan anda jika pesannya banyak). Untuk membuat teks berkedip, Anda harus menjalankan prosedur secara berkala untuk mengubah warna font teks. Metode OnTime dalam VBE dapat digunakan untuk menjalankan prosedur itu. Anda dapat menggunakan module VBA sbb:
Download file: Blinking excel 2007.zip
Prosedur untuk Teks Blinking
Public RunWhen As Double
Sub StartBlink()
With ThisWorkbook.Worksheets(“Sheet1”).Range(“A1”).Font
If .ColorIndex = 3 Then ‘ Red Text
.ColorIndex = 2 ‘ White Text
Else
.ColorIndex = 3 ‘ Red Text
End If
End With
RunWhen = Now + TimeSerial(0,0,1)
Application.OnTime RunWhen, “‘” & ThisWorkbook.Name & “‘!StartBlink”, , True
End Sub
Sub StopBlink()
ThisWorkbook.Worksheets(“Sheet1”).Range(“A1”).Font.ColorIndex = _
xlColorIndexAutomatic
Application.OnTime RunWhen, “‘” & ThisWorkbook.Name & “‘!StartBlink”, , False
End Sub
Kemudian dalam module ThisWorkbook, masukan kode berikut:
Private Sub Workbook_Open()
StartBlink
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
StopBlink
End Sub
Recent Comments