In this article, we will discuss some important questions and answers for the topic Macro as function IT 402. So here we go!!!!
Objective type questions – Macro as function IT 402
In this section, we will discuss 1 mark questions like the file in the blanks, MCQs, and True and False. So let’s begin!!!
Fill in the blanks – macro as function IT 402
- To create a function in visual basic editor click on _______________ –> __________ option. Insert –> Module
- The __________ is used to write instructions or commands in visual basic editor. function
- Click on ___________ –> __________ option from code group to open visual basic editor from MS Excel. Developer, Visual Basic
- The visual basic editor converts first letter into capital for __________. Keywords
- The function will start with as ___________ keyword in Visual Basic editor. Function (F must be capital)
- The function in Visual Basic ends with ______ ________. End Function.
- The names for values used in a function, written in the brackets are known as ___________. Parmeters or Arguments
- To access cells directly from excel into Visual Basic code editor provides _______ function. range
True/False – macro as function IT 402
- User can create their own functions or formulas in MS excel. True
- Users can create a new function from the developer tab. True
- The visual basic editor opens a module when you click on Developer –> Visual Basic option from code group in MS Excel. False
- Every name in Visual Basic must be written followed by As keyword. True
- The function created in visual basic will automatically take place in functions group in MS Excel. True
- The range() function is used to change access columns only in the visual basic code editor. Falser
- range(A1).value will access the value written in A1. True
- You can any number of values in functions created in visual basic editor. False
MCQs – macro as function IT 402
- Which of the following is the correct statement to write a function in Visual Basic editor:
- function MyFunction(val1 As Integer) As Integer …….. End Function
- Function MyFunction(val1 As Integer) As Integer ……. End Function
- MyFunction(val1 As Integer) As Integer…….End Function
- Function MyFunction(val1 As Integer) As Integer ……. EndFunction
- A ________ is a reserved word of Visual Basic.
- Main word
- Default Word
- The worksheet of MS excel is considered as ____________ in Visual Basic editor.
- The macro name given in MS excel is considered as ____________ in Visual Basic editor.
- The range() function visual basic accepts _____________ number parameters.
Short answer questions
- Explain the following parts of the visual basic editor window which is used to write a function.
- Projects – This window helps to select the part of MS excel objects like worksheets or workbooks and modules.
- Properties: Ths window help to select the various properties of the selected object of visual basic.
- Code window: It offers a space to write code for the function.
- Write a function to compute fare by taking two parameters: fare and distance
- To do this use a function name in the following manner:
Function Fare(d as Integer, ch as Integer)As Integer Fare = d * ch End Function
3. Write a macro code to assign the customer category based on the following conditions:
|More than 1500||Gold|
|1000 to 1500||Silver|
|Less Than 1000||Platinum|
Assume that the amount is entered in the B column and the worksheet contains data of 10 customers. The first row is the Header row. Assign the category in Column C.
Sub Assign_Category() For i = 2 to 11 If Range("B" & i).Value> 1500 Then Range("C" & i).Value = "Gold" Else If Range("B" & i).Value> 1000 and Range("B" & i).Value< 1500 Then Range("C" & i).Value = "Silver" Else Range("C" & i).Value = "Platinum" End If End Sub
That’s all from the questions and answers.
The programming part is not essential for class 10 students. But as the topic is given your curriculum and we don’t have any appropriate content for this topic.
I have prepared these contents according to my best knowledge. If something is missing or something is very high level according to you, please post your doubt in the comment section.
Thank you for reading this article.