QB of Section II Shared With Students of 2325 For Practice
QB of Section II Shared With Students of 2325 For Practice
Sr.No. Answer1
1 Correct syntax to create a WHILE
LOOP
WHILE...WHILE END
2 Cells().Value and Range().value
works same
3 What is output of following VBA
macro,
Sub XYZ()
Range("A1").Value = "Hello"
End Sub
Error Message
4 __________ function enables to
change value of a cell
range("A1").Value
5 The variables that does not change
the value during execution of
program is __________ Numeric
6 Which of the following is not
looping statement It Then Goto
7 Is it obligatory to declare
variables? Only if Require
Variable Declaration is
enabled
8 What is output of following VBA
macro,
Sub XYZ()
Dim i, a As Integer
a=1
For i = 1 To Range("A1").Value
Cells(i, 4).Value = a
a=a+2
Next i
End Sub
Prints 1 to value in C1
from A2
9 The default property for a text box
control is __________
Text
10 Define String Varable in VBA
Dim J as String
11 Which of the following is not a
valid data type in excel Number
12 R[-2]C will indicate
_______________ Cell Two rows above and
same column the Active
Cell
13 The Properties window plays an
important role in the development To change how objects
of Visual Basic applications. It is look and feel
14 mainly used
Which of following is incorrect, Macros allow one to
add significant power
to Excel.
15 What are the data types in VBA?
Boolean
16 A __________ variable is one that
is declared inside a procedure.
global
17 The default datatype for VB is
___________
Integer
18 In visual basic the declaration of
variables is done by _____ key
word.
int
19 Comments put in cells are called
Smart tip
20 R3C2 indicates ________ cell
C2
21 Which programming language
does VBA is based on?
Visual Borland
22 Define Integer Array in VBA
Error Message
26 What is a Macro?
It is an Excel Formula
27 A VBA unit is called a _____
Subroutine
28 ___________ referncing indicates
columns also in number
1111
29 __________ do not return a value.
Sub procedure
30 Correct syntax to create IF
statement If << condition >> Then
<< statements >> Else
<< statements >> End
If
31 Correct syntax to create a DO
WHILE LOOP Do While << condition
>> [statement ....]
Loop
32 Resize property is
used______________ Increase number of
rows in sheet
33 _________ is a built in function to
return lower bound of an array.
Lbound()
34 Define String Array in VBA
Prints 1 to value in A1
from C1
38 Correct syntax to create a FOR
LOOP
FOR..LOOP
39 _________ is used for finding out
the properties of selected control
in User form
Form layout window
40 To input the formula with R1C1
referencing, we use
_____________ method
Formula
41 ________ loop repeats a group of
statements for each item in a
collection of objects or for each
element of an array.
While loop
42 The function procedures are
___________ by default.
public
43 What is output of following VBA
macro,
Sub XYZ()
Range("A1").Value =
ActiveCell.Address
MsgBox ActiveCell.Address
End Sub
Puts in A1 and
Messages the address
of active cell
44 What is output of following VBA
macro,
Sub XYZ()
Dim temp As Double
temp = Range("A4").Value
Range("A4").Value =
Range("B4").Value
Range("B4").Value = temp
End Sub
Error Message
45 In Visual Basic, a variable name
cannot be more than __________
characters. 255
46 OffSet property is
used______________
Increase the range
47 Which of the following VBA
windows shows the code of the
active object? Explorer Window
48 When the user clicks a button,
_________ is triggered.
an event
49 The ______ is a tool used for both
the Input and output purpose.
label
50 The output of- OFFSET(A1,4,3,2,3)
is_________
The Value in Cell G7
51 The _________ allows direct exit
from a For loop, Do loop, Sub
procedure, or Function procedure. Break
52 What is the shortcut key to open
VBA editor, in excel?
ALT+F9
53 MDI stands for _________
Multiple Document
Interface.
54 __________ statement enables us
to trap runtime error.
Error
55 Which of the following VBA
windows shows the code of the
active object?
Explorer Window
56 When the user clicks a button,
_________ is triggered.
an event
57 We can use ________ statement
to search last row of data =Cells(Rows.count,1).E
nd(xlUp).Row
58 Which of the following refers to
computer code, in VBA, that
performs some action on or with Excel function
59 objects?
Visual Basic is a tool that allows
you to develop application in
__________ Real time
60 __________ character use to put
comment in VBA
"
61 Define Integer Varable in VBA Dim i As Integer
62 I want that Excel should mandate
me to declare every variable I use No, such facility is not
in my program with DIM available
statement. How do I do it?
63 what is the output of
"ActiveCell.Value =
ActiveCell.Offset(-1, 0).Value + 1"
statement Will fetch value of
previous column and
same row of active
cell, add in in it and
put it in active cell
64 Which variable is private and
which is public? Dim B
As String
Sub DeclareVar()
Dim A As String
A = "Product "
B = "ID"
End Sub
Sub PrintVar()
Range("A1").Value = A
Range("B1").Value = B
End Sub
B is Public , A is Local
65 User Defined Function returns of function name
variable _________________
66 range("A1:C3").offset(2,3).select D3:F5
statement will select range
____________.
67 To retain the data in an dynamic
array __________ ketword is used
with ReDim statement Retain
68 Which code block will check Dim Num As Integer
whether the number entered in A1 Num =
is ODD or EVEN and syntactically Range("A1").Value
right? If Num Mod 2 = 0
Then
Range("A2").Value =
"Even"
Else
Range("A2").Value =
"Odd"
End If
Next sh
End Sub
WHILE…..END WHILE...WEND
change("A1").Value update("A1").value
String Constant
Do Until Do While
Enable Multiline
Character Label
Two Columns left and
same row of the active Two Columns right and same row of
cell the active cell
When opening To allow the developer to
programs stored on graphically design program
aThey
hardare
drive
small components
programs that can
be called from a You can create functions or
spreadsheet. subroutines.
Byte Currency
local external
Decimal Variant
dim static
B3 B2
Dim IntArr As
Integer Dim IntArr As Integer Array
Compiling Debugging
MessageBox MessageBox()
Displays
messagebox with Types value in message in cell
message
It is a shortcut A1 of active sheet
which runs a
recorded or written It is a built-in process included in
process. Excel.
Routine Macro
AAAA R1C1
Do While <<
condition >> Do While << condition >>
[statement ....] End [statement ....] End Loop
LRbound() Lowbound()
a statistical tool
developed by
Microsoft for an open-source programming
financial analysts environment
private protected
Puts in A1 the
address of active Messages the address of active
cell cell
300 355
a method a setting
ALT+F8 ALT+F11
Multiple Design Manipulated Document
Interface. Interface.
a method a setting
=Cells(Columns.cou
nt,1).End(xlUp).Colu =Cells(Rows.count,1).End(xlUp).
mn Column
Graphical User
Interface Character User Interface
# '
Dim i As Int Dim i As Integer.value
Use OPTION
EXPLICIT statement Use OPTION BASE 1 statement
Will fetch value of
previous row and
same column of Will fetch value of previous row
active cell, add in in and previous column of active
it and put it in cell, add in in it and put it in
active cell active cell
A is Public , B is
Local Both are Public
mentioned after mentioned in the Return
function name statement
A1:C2 A1:B3
Continue Occupy
Dim Num As Integer Dim Num As Integer
Num = Num = Cells("A1").Value
Range(A1).Value If Num Mod 2 = 0 Then
If Num Mod 2 = 0 Cells("A2").Value = "Even"
Then Else
Range(A2).Value Cells("A2").Value = "Odd"
= "Even" End If
Else
Range(A2).Value
= "Odd"
End If
Workbook Worksheets
1 -1
WHILEWEND…..........ST
OP 3 CO4(100)
3 CO5(100)
1 CO5(100)
Date 3 CO5(100)
3 CO4(100)
Will go in infinite loop 3 CO6(100)
1 CO4(100)
Date/time 5 CO4(100)
All of
String these 5 CO4(100)
project 2 CO4(100)
String 3 CO4(100)
declare 2 CO4(100)
C3 2 CO6(100)
1 CO5(100)
1 CO5(100)
2 CO4(100)
Program 3 CO4(100)
C1R1 3 CO5(100)
1 CO5(100)
1 CO5(100)
Increase number of
sheets in the workbook 2 CO5(100)
LB() 1 CO5(100)
1 CO5(100)
a Microsoft
programming
environment that
replaces Excel 1 CO4(100)
Multidimensional 3 CO4(100)
Will go in infinite loop 1 CO6(100)
FORNEXT….........STOP 3 CO5(100)
No such formula
available 3 CO5(100)
Friend 1 CO4(100)
Error 3 CO6(100)
a property 1 CO5(100)
Exit Do 2 CO5(100)
ALT+F10 3 CO4(100)
Error In 2 CO4(100)
a property 1 CO5(100)
=Cells(Columns.count,1)
.End(xlUp).Row 1 CO5(100)
+ 3 CO4(100)
1 CO5(100)
VBA by dafualt
mandates it. No need to
do anything 2 CO5(100)
Error 2 CO6(100)
C4:E6
1 CO5(100)
Preserve 4 CO5(100 4
Dim Num As Integer
Num =
Range("A1").Value
If Num Mod 2 = 0 Then
Range("A2").Value =
"Even"
Else if
Range("A2").Value =
"Odd"
End If
CO6(100)
Worksheet's Open
Event
CO5(100)
Names
CO5(100)
Will return lastrow in
the column which has
data 3 CO5(100)
Error
2 CO5(100)
Programer defined 1
CO5(100)
Irrelevant statement
3 CO5(100)
CO6(100)
Checks data in each cell 2
of Column 2 and colors
it with Red if it contain
Data mentioned in Cell
A2
CO6(100)
Error 3
CO6(100)
Delete all values in 1
Column B
CO6(100)
Highlights A1 of Last 3
Sheet with Red Color
CO6(100)
Neighther True not 1
False
CO4(100)