Page 430 - Computer Software Application TP - Volume 1
P. 430
COMPUTER SOFTWARE APPLICATION - CITS
Step 2.2: Set the required properties as follows:
For Example:
Sl. No Control Property Value
1 CommndButton1 Name cmdarea
Caption Area
2 CommandButton2 Name cmdclear
Caption Clear
Step 3: Double Click on each Control and write down the Code .
Private Sub cmdarea_Click()
Dim length As Integer, breadth As Integer
length = Range(“B2”)
breadth = Range(“B3”)
Range(“A5”) = “Area is”
Range(“B5”) = length * breadth
End Sub
Private Sub cmdclear_Click()
Range(“A5,B2:B5”) = “ “
End Sub
Step 4 : Then save the workbook type as a ‘Excel Macro- Enabled Workbook’
Step 5: Run the Macro
Step 5.1: Click on the Design mode icon to turn of the Design mode .
415
CITS : IT & ITES - Computer Software Application - Exercise 70