Lesson 4L Macro Programming
Lesson 4L Macro Programming
1. Worksheet functions
a. Basic functions - ex. MDAS, AVE, IF, etc
Discussed in Lesson 3L
b. Advance functions - ex. VLOOKUP, SUMIF
c. Customized functions - ex. Converting numbers into texts
2. Formatting
a. Basic Formatting - The use of Ctrl + 1 Discussed in Lesson 3L
b. Conditional Formatting - ALT + O + D
Exercise 1 :
What to do: Format the cell according to the conditions
Write "apple" in the box, then the box will turn into red.
If you write "banana" it will turn into green, then if
you do not writing anything, or you write other words
aside from apple and banana, the box will show no color
3. Data Handling
a. Data validation - ALT + D + L Discussed in Lesson 3L
What to do:
1. Data Validation - Limit data input in columns A to D, whole number from 1 to 100 only
2. Protect the average cell, J47.
lcbajpclass page 1
Exercise 4 - Importing text file
What to do:
1. Open Text File. Check the file then close it.
2. From the excel file, click sheet2. Click File, Open the text file. (To view all the files in the
folder, select file types - all files)
3. An option box will appear then listen to the professor for instruction
2. Put your cursor anywhere you like, as long as you can see it, or just inside the box.
lcbajpclass page 2
Viewing the VBA behind the macro recorded
1. Select Module 1 from left side area of VBE (called as Project Explorer).
2. Double click on it to open it in Editor Area (top right, big white rectangle)
3. You can see the VBA Code behind the recorded macro
lcbajpclass page 3
SUPPLIER DATABASE
SUPPLIER NAME
ADDRESS
CONTACT PERSON
CONTACT NO.
VAT TYPE
NON-VAT SERVICES
LINE
NON-VAT GOODS
VAT SERVICES
DUPLICATE SUPPLIER (1=YES /0 =NO)