Microsoft Excel VBA (Visual Basic for Applications) Programming Language
Objectives: Create an array and redim it to a size equal to an assigned value of a variable, populate the array with a series of random numbers, output the array to a message box and to a worksheet.
Instructions:
- Review the variables already declared. You won't need others.
- See comments in the code that will act as your guide. Add new code directly after each comment.
- Assign a value of intRandom. (start with 20, change it later, if desired)
- ReDim the array to be of a size equal to the previous variable.
- Fill the array with random numbers using RND function.
- Loop through the array and create a message string.
- Also, create a title that pulls the value of the sixth elements.
- Display the title and message in a Msgbox.
- Output the array to the output sheet with index value in column A and the random number in column B.
Lines of code needed: about 16 including 3 for each of 3 loops
The message box should like like the following:

________________________________________________________
Option Explicit
Option Base 1
' ******** DSS 620 TEMPLATE ---- Created by John A. Michl jmichl@sju.edu ********
' **
' ** Module 4 Exercise 2
' ** Template Revision: 01/12/2018 v1.1 by John A. Michl
' ** Note: Professor's comments preceeded by '[
' ** Instructions / hints preceeded by '>>
' ** Student comments should use apostrophe only
' **
' ** Assignment modified by STUDENT NAME on DATE
' **
' ******************************************************************************
Sub RandomList()
' all variables needed for Part A have been declared
Dim i As Integer ' number of random numbers to make
Dim intRandom As Integer ' number of random numbers to make
Dim arrRandom() As Single ' array in which to store numbers
Dim strMsg As String
Dim strTitle As String
Randomize ' this initializes the random number generator
Debug.Print Rnd ' just to show how easy it is to create a
Worksheets("Output").Range("A:B").Clear ' remove old results
']vvvvv Student code below vvvvvv
'] assign a value to intRandom
'] redim the array to be the appropriate size
'] fill the array with random numbers using a loop
'] create the list of numbers for the message string using a loop
'] be sure to include both the index value i and the contents of the array
'] create the message title to show the random number in position 6 of the array
'] see the screen shot but note the random numbers will be different
'] display the message box
'] output the array to the output worksheet showing the index number in
'] column A and the random number in column B
'^^^^ Student code above
End Sub
Sub RandomList()
' all variables needed for Part A have been declared
Dim i As Integer ' number of random numbers to make
Dim intRandom As Integer ' number of random numbers to make
Dim arrRandom() As Single ' array in which to store numbers
Dim strMsg As String
Dim strTitle As String
Randomize ' this initializes the random number generator
Debug.Print Rnd ' just to show how easy it is to create a
Worksheets("Output").Range("A:B").Clear ' remove old results
']vvvvv Student code below vvvvvv
'] assign a value to intRandom
intRandom = 20
'] redim the array to be the appropriate size
ReDim arrRandom(intRandom)
'] fill the array with random numbers using a loop
For i = 1 To intRandom
arrRandom(i - 1) = Int((25 - 10 + 1) * Rnd + 10)
Next i
'] create the list of numbers for the message string using a
loop
'] be sure to include both the index value i and the contents of
the array
For i = 1 To intRandom
strMsg = strMg + Str(arrRandom(i - 1)) + " "
Next i
'] create the message title to show the random number in position 6
of the array
'] see the screen shot but note the random numbers will be
different
strTitle = Str(arrRandom(6))
'] display the message box
MsgBox strMsg, vbInformation, strTitle
'] output the array to the output worksheet showing the index
number in
'] column A and the random number in column B
For i = 1 To intRandom
Sheets("Output").Cells(i, 1) = i
Sheets("Output").Cells(i, 2) = arrRandom(i - 1)
Next i
'^^^^ Student code above
End Sub
________________________________________________________________________________________________
image screenshot

thank you !
Microsoft Excel VBA (Visual Basic for Applications) Programming Language Objectives: Create an array and redim it...
Visual Basic 2017: Create a program to do the following: Fill a string array with the grades from a file with the statement: (note the grades.txt is on moodle and must be placed in the project’s bin/Debug folder for proper execution) Dim GradeStr() As String = IO.File.ReadAllLines(“grades.txt”) Then do the following steps: • Dim another array called Grades() of type double to the same size as the string array • Convert and copy each element from the string array GradeStr()...
Can someone please help, third time I'm asking. I need a basic javascript with no push or splice command. Please don't post a picture of the code,because my vision is poor and I won't be able to see it. Also, I need breakdown of what's in HTMLand what' s in javascript. All requirements are below. Thanks for your help. This is a 2 part assignment, but both parts can be completed in one program. Also, please follow ALL Required Programming...
Variable Size Array with Classes, Testing. Study Code and Object Definition Windows of Microsoft Visual Studio described here. As you work on the below project, demonstrate to the instructor the usage of this feature. Create a project titled Lab11_VarArrayTest. Implement the dynamically expanding and contracting array of doubles described in the previous lab as a class. You should use this class definition. The class attributes are a pointer to the dynamically allocated array dAarray and the array size size This...
Must be done in C# please! Thanks!
In this assignment you will create a program named Test Scores that displays the average of all tests; average midterm score; average final score; and displays the midterm or final score of a particular student. Create a class level two dimensional integer array named Grades initialized with the following data: 897 242 301 987 116 450 865 128 992 109 88 75 94 70 90 87 81 79 97 79 78 80 92...
Create a program that uses a Jagged Array. The program will create an array with 50 rows. Each of the values for each element of the array will be randomly generated. The random values will be between 1 and 20. Depending on the value generated for each row, you will create an array with that number of columns for that row. Each column created will contain the value to the left plus 1. After you create and populate the entire...
follow the instructions inside. You are to implement the sequential search of array elements. User will enter a value (size) which represents the number of values to process The values entered will be stored in an array of type short that has 1000 elements User will enter size numbers The user will enter a search value The program will search the data for a specific value program will display a message in which element the value was found or display...
Create a Raptor Flowchart and Pseudocode for the following: That searches an array of size 15 that holds a collection of numbers, for the value 7. First we take input from the user to fill each element in the array. Then we search the array for value 7. If value 7 is not found we output: "Value 7 is not contained in array[]", otherwise if the value 7 is found output: "Value 7 is contained in array[] at index" and...
Visual Basic: Create an application that simulates a tic tac toe game. The form uses 9 large labels to display the x's and o's. The application should use a two dimensional integer array to simulate the game board in memory. When the user clicks the "New Game" button the application should step throguh the array storing a random number of 0 to 1 in each element. The numer 0 represent the letter o and the number 1 reprsents the letter...
I have a programming assignment for a introductory c++ class and I am really struggling writing this program. Below are the assignment requirements, I am unable to use vectors in stl and I keep getting a ton of compiling errors. Thank you chegg experts. You have really helped me out this semester. Your responses and code has cleared up so many issues ive had. Description The purpose of this challenge is to employ the use of basic functions and arrays....
In the "Go" button add 15 random numbers in the array using a random number generator. Remove the call to "SetToZero" and the code following. Remove the "SetToZero" method. Add Access Keys of your choice Assign an accept button Assign cancel button (Exit) Add a Button "Find Max" Write an appropriately named method that Accepts the array Finds the largest int and returns the value "Find Max" button click Calls above method Opens a MessageBox to display the returned value...