00:01
Hello student here create a vba algorithm that calculate the sum and the product of 30 digits in a 2d array 3x10 and display the sum and the product in the dialog box using message box.
00:13
So here vba visual basic for application to create a macro that calculate the sum and the product of 30 digits in the 2d array i .e.
00:21
3 rows 10 columns.
00:23
So display the result in a message box here the vba code example to achieve this.
00:27
So first i have calculated sub calculate sum and product.
00:32
So here i have written now matrix as an integer now j as integer j as integer i as integer j as integer.
00:42
So here sum as long and product as long.
00:47
So here fill the matrix with the integer you notify this part as needed.
00:52
So i equal to 3 j equal to this can be modified according to the dimension here dimensions are this that's why i have taken 3 and here i have taken 10.
01:04
So here 3 rows and 10 columns are this.
01:11
So these are 3 rows.
01:12
So here matrix element have to fill i j.
01:16
So these are the cell which we have to fill by i into j multiplications rows into column indexes now increment in the j loop increment in the i loop.
01:29
So after this calculate the sum and the product.
01:32
First i have created the element of the matrix by this.
01:36
Now i have to calculate the sum and the product.
01:38
So initialize sum equal to 0 and product equal to 0 both are initialized to product equal to 1.
01:44
Both are initialized.
01:45
Now again the loop i equal to 3 j equal to 1 to 10.
01:49
Now i have to do the sum.
01:51
So here i am writing sum into matrix i j...