TB512 Excel VBA


MS EXCEL MACROS OR VBA (Virtual Basic Application)

Tips for Beginners, send Email or YM! for inquiry and help


adsense

adsense links

Thursday, November 20, 2008

Hitung Red Font

---------- Forwarded message ----------
From: Safri Ishak <safri.ishak@gmail.com>
Date: Wed, Nov 12, 2008 at 6:30 PM
Subject: Re: ]] XL-mania [[ Hitung red Font
To: XL-mania@yahoogroups.com


Dear John,

if you dare :) to use macro, please download and try the attached excel file.

siapa takut .... he he.

--
Thank you and regards,
Safri
www.tb512.com my virtual home
www.tebetbarat.com Tebet Business Directory consists of addresses and phone numbers of favorite restaurants, traditional markets, hotels, offices, schools, super markets, malls, automotive, gardens, flowers, cakes, advertising, computers, salons, barber shops, cosmetics, banks, apartments etc.
Originally it was compiled for personal purposes and then published to the internet as a gateway to search business directory and websites in Tebet and surrounding area.

2008/11/12 John Robert May <jrobertm@abadiadimulia.com>

Dear XL Mania,

Minta tolon seperti kasus dibawah ini,

Jakarta

23

Semarang

16

Surabaya

22

Bali

11

Makasar

19

Jumlah Angka "Red Font"

2

( Note : didapat dari Conditional Formating)

Tanya : Bagaimana rumusnya pada Cell D10, supaya dapat menghitung jumlah angka yg ber - Red Font pada Range D2 - D6

Help me please





--
Thank you and regards,
Safri
www.tb512.com my virtual home
www.tebetbarat.com Tebet Business Directory consists of addresses and phone numbers of favorite restaurants, traditional markets, hotels, offices, schools, super markets, malls, automotive, gardens, flowers, cakes, advertising, computers, salons, barber shops, cosmetics, banks, apartments etc.
Originally it was compiled for personal purposes and then published to the internet as a gateway to search business directory and websites in Tebet and surrounding area.

Lookup Gambar masuk Userform



---------- Forwarded message ----------
From: Safri Ishak <safri.ishak@gmail.com>
Date: Wed, Nov 19, 2008 at 3:05 PM
Subject: Re: ]] XL-mania [[ lookup gambar masuk userform
To: XL-mania@yahoogroups.com


mas rizaldi,
saya coba buat makro seperti the attached excel file
silahkan didownload dan dicoba
janan lupa photo didownload ke dalam folder yang sama dengan makro
mudah2an berkenan

loadpicture saya contek dari jawaban ibu guru siti ....... he he.

--
Thank you and regards,
Safri
www.tb512.com my virtual home
www.tebetbarat.com Tebet Business Directory consists of addresses and phone numbers of favorite restaurants, traditional markets, hotels, offices, schools, super markets, malls, automotive, gardens, flowers, cakes, advertising, computers, salons, barber shops, cosmetics, banks, apartments etc.
Originally it was compiled for personal purposes and then published to the internet as a gateway to search business directory and websites in Tebet and surrounding area.

2008/11/19 rizaldi <Rizaldi.DjunaediAlKaaf@pajak.go.id>

TERIMA KASIH atas jawabannya mbk CTV

(saya ga ngerti koding babar blas hehe)

Tapi ini masih "belum sesuai keinginan/maksud" saya hehehe

Soalnya file picture yang saya punya itu bbuuaaanyak,,,yang saya ingin kan semacam "search" yang saya ketik or klik (septi pada pertanyaan saya pada attachment saya) lalu di preview melalui user form itu,,,

Maksut dan tujuan saya,,, kan di excel itu ceritanya ada banyak data2 misal data Wajib Pajak yang tentunya memiliki NPWP,,,nah jadi maksut saya ketika saya mengetik NPWP/mengKlik NPWP dari suatu WP, saya dapat memPREVIEW foto WP tersebut misalnya dengan menyajikan data2 WP tersebut dalam excel,,,kenapa saya pake userform,,karena menurut saya dengan make user form itu jadi lebih flexible,,dapat digerak2an/digeser dll

Mohon bantuannya lagi…

(saya attach lagi ya pertanyaan saya..??)

Tengs

Regards,

From: XL-mania@yahoogroups.com [mailto:XL-mania@yahoogroups.com] On Behalf Of siti Vi
Sent: 19 Nopember 2008 8:54
To: XL-mania@yahoogroups.com
Subject: Re: ]] XL-mania [[ lookup gambar masuk userform

kalau dengan userforms, katanya,
memasukkan image ke object melalui coding adalah
dengan property Picture,
instruksinya
Object.Picture = LoadPicture(PathDanNamaFIleImage)

kalau di sheet tidak perlu pakai userform kan sudah ada object Picture
yg bisa diisi gambar melalui formula. seperti yg bang mods buat.



2008/11/17 rizaldi <Rizaldi.DjunaediAlKaaf@pajak.go.id>
>
> Assalamu'alaikum>
> Help ni buat para pakar excel,,pertanyaan saya ada pada attachment
> (mirip2 dengan lookup gambar pada "50 jurus rahasia excel")
>

__._,_.___
Recent Activity
Visit Your Group
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

All-Bran

Day 10 Club

on Yahoo! Groups

Feel better with fiber.

Special K Group

on Yahoo! Groups

Learn how others

are losing pounds.

.

__,_._,___


--
Thank you and regards,
Safri
www.tb512.com my virtual home
www.tebetbarat.com Tebet Business Directory consists of addresses and phone numbers of favorite restaurants, traditional markets, hotels, offices, schools, super markets, malls, automotive, gardens, flowers, cakes, advertising, computers, salons, barber shops, cosmetics, banks, apartments etc.
Originally it was compiled for personal purposes and then published to the internet as a gateway to search business directory and websites in Tebet and surrounding area.

Thursday, October 9, 2008

01 Display Messag Box

My First Macro
Copy and paste the following statements to Visual Basic Editor:
Option Explicit
Sub TEST()
MsgBox "My First Macro"
End Sub




My First Macro

Exctracted from Excel Macro
Help.

Option Explicit Statement
Used at module level to force explicit declaration of all variables
in that module.
Syntax
Option Explicit

Remarks
If used, the Option Explicit statement must appear
in a module before any procedures.
When Option Explicit appears in a module,
you must explicitly declare all variables using the Dim, Private, Public,
ReDim, or Static
statements.
If you attempt to use an undeclared variable name, an error occurs
at compile time.
If you don't use the Option Explicit statement, all
undeclared variables are of Variant type unless the default type is
otherwise specified
with a Deftype statement.
Note Use Option Explicit to avoid incorrectly
typing the name of an existing variable or to avoid confusion in code
where the scope of
the variable is not clear.

Option Explicit Statement

Dengan menggunakan option ini, maka semua variable (akan kita diskusikan
lebih lanjut) harus di deklarasikan.

Option Explicit harus dibuat dan
diletakkan paling atas,
sebelum prosedur yang lain. Untuk menghindari kesalahan meng-edit
pada waktu menggunakan variable, sangat dianjurkan untuk memakai Option
Explicit.


Sub TEST() Statement
Declares the name, arguments, and code that form the
body of a Sub procedure.

Syntax

[Private | Public | Friend] [Static] Sub name [(arglist)]

[statements]

[Exit Sub]

[statements]

End Sub

Sub TEST() Statement

Digunakan untuk mendeklarasikan nama prosedur,
argumen dan perintah yang akan membentuk sebuah Sub prosedur. Semua
prosedur didalam Excel Macro dimulai dengan Sub statement dan diakhiri
dengan End Sub. Dalam contoh ini nama yang digunakan adalah TEST.

MsgBox Statement

Displays a message in a dialog box, waits for the user
to click a button, and returns an Integer indicating which button the
user clicked.

Syntax
MsgBox(prompt[, buttons] [, title] [, helpfile, context])

The MsgBox function syntax has these named arguments:

prompt Required. String expression displayed as the message in the
dialog box. The maximum length of prompt is approximately 1024 characters,
depending on the width of the characters used. If prompt consists
of more than one line, you can separate the lines using a carriage
return character (Chr(13)), a linefeed character (Chr(10)), or carriage
return – linefeed character combination (Chr(13) & Chr(10))
between each line.

buttons Optional. Numeric expression that is the sum of values specifying
the number and type of buttons to display, the icon style to use, the
identity of the default button, and the modality of the message box.
If omitted, the default value for buttons is 0.

title Optional. String expression displayed in the title bar of the
dialog box. If you omit title, the application name is placed in the
title bar.

helpfile Optional. String expression that identifies the Help file
to use to provide context-sensitive Help for the dialog box. If helpfile
is provided, context must also be provided.

context Optional. Numeric expression that is the Help context number
assigned to the appropriate Help topic by the Help author. If context
is provided, helpfile must also be provided.

MsgBox "My First Macro" Statement

Digunakan untuk menampilkan kata-kata My First
Macro di layar monitor.

Untuk mencoba macro ini,
silahkan tekan F5 dari Macro Editor
, click RUN, untuk mengakhiri macro click
OK.

Click
icon untuk melihat gambar dengan ukuran yang lebih besar.

04 Edit Macro


Edit Macro

Open Excel, On Excel worksheet, click Tools, click Macro, click Visual
Basic Editor.

On Visual Basic Editor, click Insert, click Module.



Wednesday, October 8, 2008

02 Enable Macro



Enable Macro

to run in Excel Workbook

Open Excel, click Tools, click Macro, click Security, select
Medium and click OK. Close Excel.

Note: we need to do it only once.