1、vba综合练习(VBA comprehensive exercises)The result is obtained by programming.The 9786 said two addends and which a number is divisible by 91, and the other a number is divisible by 87. Request: in the two parts, can be divisible by 91 is equal to the number of the number?Answer 4914Programming:For I =
2、91, to 9786, step 91For J =87 to 9786 step 87If I +j = 9786 thenMsgboxSeek S = 1/5 +, 1/10 +, 1/15 +, 1/20 +, 1/25 +. + 1/ (5*n) +. The former n and S, when the first time is greater than or equal to 1.4 at n to stop the calculation, the number of _.Answer 616S=0A=1Do while sc3, A., lab1.Value = a,
3、B., lab1.Value = bC., lab1.Caption = C, D., lab1.Caption = kAnswer DCDAdd a command button (called CMD) on the form, and then write the following event procedure. Click the command button, and each element in the array P (6,8) is given the sum of the squares of its two corresponding subscript values
4、, so complete the program.Private, Sub, cmd_Click ()Dim, P (6,8), As, integer, I, As, integer, J, As, integerFor _1_ To 6For j=0 To _2_P (I, J) = _3_Next JNext IEnd Sub1, A., i0, B., i0, C., i=1, D., i=02 A. 6, B. 7, C. 8, D. 93, A. (i+j), 2, B., i2+j, C., i+j2, D., i2+j2Answer DCD1 text box control
5、s, txt1, and 1 command button controls CMD1 have been created on the form. Please complete procedures to complete the following operations:When the program is running, the text box shows “VBA programming“, and the title of the command button shows “hide“;When the command button is clicked, the text
6、box disappears;Displays a text box when you click form.Private, Sub, _1_ ()Txt1.Visible = FalseEnd SubPrivate, Sub, Form_Click ()Txt1.Visible = _2_End SubPrivate, Sub, Form_Load ()Txt1.Value = “VBA programming“Txt1.Visible = TrueCmd1._3_ = “hide“End Sub1, A., command1_Click, B., Lab1_ClickC. Form_Lo
7、ad D. cmd1_Click2, A., False, B., TrueC. “hide“ “D.“ display“3 A. Visible B.valuec. click caption d.答案 doc在 access 中, 宏的种类包括 _ _ _ _ _ _ _.a.繁难宏 b.条件宏 c.宏组 d.简单宏答案 bcds在 vba 中, 对于 (或 function) 过程中的每一个形参, 可用于声明其参数传递方式的关键字包括 _ _ _ _ _ _ _.a.byme b.byvalc.byref d.byvba答案 cb下面 _ _ _ _ _ _ 是合法的变量名.a.str-
8、name b. houses c.for _ 99 d.abc2006答案 cd在宏中, openreport 操作可用来打开指定的 _ _ _ _ _ _ _.a.查询 b.状态栏 c. 窗体 d.报表答案 d对 vba 中的逻辑值进行算术运算时, true 值被当做 - 1, false 当做 _ _ _ _ _ _ _.a.1 b.2 c.0 d.3答案 c在 vba 中, dim a (3,3) as bollean “语句定义了一个数组, 该数组中的全部元素都初始化为 _ _ _ _ _ _.a. true b false c. 1 d.1.答案 b在窗体上添加一个命令按钮 (名为
9、cmd13), 然后编写如下事件过程:private sub cmd13 _ click ()dim x as string, y as stringx = “龙洞华美路中山大学新华学院法学院“y = “2006级法学专业学生“msgboxyou mid (x 6.4) & right (x 3) & left (y, 9)end sub打开窗体运行后, 单击命令按钮, 消息框中的输出内容是 _ _ _ _ _ _.a.龙洞华美路中山大学新华学院法学院 2006级法学专业学生b.中山大学新华学院法学院 2006级法学专业学生c.中山大学法学院 2006级法学专业学生d.中山大学法学院 2006
10、级法学专业答案 d以下 vba 程序段运行后, 变量 j 的值是 _ _ _ _ _ _.y = 89j = “不及格“do while y 60j = iif (y 12A (I) =i2 - II=i+1LoopA.1 B.128 C.132 D.144Answer cIn VBA, the expression of Not (Not (8-35) value is _.A.True, B.False, C.And, D., OrAnswer BIn VBA, the expression (52 Mod 8) = 4 value is _.A.True, B.False, C.And,
11、 D., OrAnswer BThe expression of IIf (0, 60, 100) is the result of _.A.0 B.60 C.100 D.160Answer cRun the following VBA program, the value of the variable J is _.K = 10J = 0DoK = K + 10J = j + 1Loop, Until, k 20A.1 B.2 C.4 D.10Answer BIn VBA, the type specifier # said the data type is _.A. integer, B
12、. long integer, C. single precision, D. double precision typeAnswer DThe following is the operation sequence design of macro h:Conditional operation operation parametertxt1=2 MsgBox news is “Beijing“. MsgBox news is “Shanghai“MsgBox news is “Guangzhou“We set the click event attribute for Acer H form
13、 “SYSU“ named “CMD1“ on the command button, open the form “SYSU“ after the operation, in the form of the name “txt1“ text box, enter the number 1, and then click the command button is CMD1.The A. screen pops up a message box to display the message “Beijing“The B. screen will pop up two message boxes
14、, displaying messages “Beijing“ and “Shanghai“C. screen will pop-up three message boxes, respectively, to display the message “Beijing“, “Shanghai“, “Guangzhou“The D. screen pops up a message box to display the message “Guangzhou“Answer DThe end of the following VBA code after the operation, the val
15、ue of the variable a is _.A=0B=101DoB=b-20A=a+bLoop While b80A.60 B.140 C.142 D.160Answer cIn Access, when the set of grouping field data access page, start control is shown or hidden in each _.A. records the source B. field, and C. records the D. data tableAnswer cThe following program segments are
16、 set up as shown in the figure D (subscript 1) and fill in the missing part:123456212345321234432123543212654321Dim D (1, To 6, 1, To 6)For J = 1, To 6For k = 1, To 6D (J, K) = Abs (_) + 1Next KNext JA.j B.j-k+1 C.j-k D.2*j-kAnswer cAn existing form has been built. There is a command button in the f
17、orm. Click this button,Opens the product quantity statistics report, if the VBA code is complete, the following statements are true _.A.Docmd.OpenForm “product quantity statistics“B.Docmd.OpenView “product quantity statistics“C.Docmd.OpenTable “product quantity statistics“D.Docmd.OpenReport “product
18、 quantity statistics“Answer DIn VBA, the expression 234=6 value is _.A.True, B.False, C.And, D., OrAnswer BOn the macro execution, the following is not true is _.A. in the Database window, select the macro group name in the macro object list, and double-click to directly run all macro actions in the
19、 first macro of the macro groupB. in the Database window, select the macro group name in the macro object list and double-click, and you cant directly run all macro actions of the second macros in the macro groupC. can run another macro in a macroD. does not automatically run the AutoExec macro when
20、 it opens the databaseAnswer DIn VBA, the expression of 33/216 And (1653) value is _.A.True, B.False, C.And, D., OrAnswer BAdd a command button (called cmd12) on the form, and then write the following event procedure:Private, Sub, cmd12_Click ()Dim, PI, As, Single, N, As, IntegerPi = 3.14N = Len (St
21、r (PI) & Space (2) - is the length of this string)MsgBox nEnd SubOpen the form after the operation, click the command button to output the contents of the message box is _.A.11 B.12 C.13 D.14Answer DThe following statements, statements define the form of head load event process is _.A.Private, Sub,
22、Form_Chang ()B.Private, Sub, Form_LostFocus ()C.Private, Sub, Form_Load ()D.Private, Sub, Form_Open ()Answer cOpen a Access database, create a data access page, on the set of “page“ object in the list box is a data access page _.A. web page, B. database file, C. shortcut, D. sub tableAnswer cIn VBA,
23、 variable declaration statement “Dim a#, B AS integer“ variables in the type of a is _.A. integer, B. double precision, C. long integer, D. variantAnswer BIn the design of macro view window in the lower half part is _.A. operation parameter area, B. design zone, C. print zone, D. status zoneAnswer aIn the macro, used to display all the recorded macro command is _.A.MsgboxAllRecords B.ShowAllRecordsC.SetValue D.RestoreAnswer B