Question

In: Computer Science

Review the following code: Sub RunLoop() For n = 1 to 100 ActiveSheet.Range("A" & n).Value =...

Review the following code:
Sub RunLoop()
For n = 1 to 100
ActiveSheet.Range("A" & n).Value = n
End Sub

Solutions

Expert Solution

This is an MS Excel VBA code.

It prints values from 1 to 100 in the row A of an active tab in an excel worksheet.

Incorrect code

Sub RunLoop()
For n = 1 to 100
ActiveSheet.Range("A" & n).Value = n
End Sub

Correct code

Sub RunLoop()
For n = 1 to 100
ActiveSheet.Range("A" & n).Value = n
Next n
End Sub

Statement in red (Next n) was missing.

Snapshot of the code

Snapshot of the output

This will go up until 100.

Let me know if this is clear.


Related Solutions

What is the value of n after this code runs? 1 Point int n = 0;...
What is the value of n after this code runs? 1 Point int n = 0; int j = 7; if ((j!=0) && (n < 25)) { n = 1; if (j > 4) { n = 2; } else { n = 3; } } else { n = 4; if (j%2 >= 2) { n = 5; } else { n = 6; } }
1. During 2012, Parent sold inventory originally costing 60,000 to its 100% Sub for 75,000. Sub...
1. During 2012, Parent sold inventory originally costing 60,000 to its 100% Sub for 75,000. Sub sold all but 10,000 of the inventory purchased from Parent for 70,000 to external entities. What is the unrealized gross profit? 2.During 2012, Parent sold inventory originally costing 60,000 to its 100% Sub for 75,000. Sub sold all but 10,000 of the inventory purchased from Parent for 70,000 to external entities. What is the gross profit percent? 3.During 2012, Parent sold inventory originally costing...
Consider the following pseudo-code: /* Global memory area accessible by threads */ #define N 100 struct...
Consider the following pseudo-code: /* Global memory area accessible by threads */ #define N 100 struct frame *emptyStack[N]; struct frame *displayQueue[N]; int main() { /* ** Initialise by allocating the memory for N frames ** And place the N frame addresses into the ** empty Stack array */ Initialise(); thread_t tid1, tid2; threadCreate(&tid1, GetFrame); threadCreate(&tid2, ShowFrame); sleep(300); } GetFrame() { struct frame *frame; struct frame local; while (1) { CameraGrab(&local); /* get a frame from the camera store it in...
Write a code using c# Maximum Sub Array.
Write a code using c# Maximum Sub Array.
1.       Assume the following recursive formula: R(n)=R(n-1)*n*n where R(0)=1 The code might look like this: public double...
1.       Assume the following recursive formula: R(n)=R(n-1)*n*n where R(0)=1 The code might look like this: public double R(n) {               If n==0 return 1               else return R(n-1); } a.       What is the recurrence relation showing the number of multiplications for the recursive function R(n) and program? b.       Solve the recurrence relation. 2.       Show the following is true for all integers n > 1 using mathematical induction:    3.       Sort the following list into alphabetical order using selection sort. Write the list showing the swapped...
On January 1, Year 1, Josh Corp. sold equipment to Mayfair Inc. (its 100% sub) for...
On January 1, Year 1, Josh Corp. sold equipment to Mayfair Inc. (its 100% sub) for $120,000 in cash. The equipment originally cost $160,000 but had a book value of $96,000 when transferred. On that date, the equipment had a five-year remaining life 1.       Prepare the consolidation entries relating to the equipment sale for 12/31, Year 1. 2.      Prepare the consolidation entries relating to the equipment sale for 12/31, Year 2.
Find the value of ∑(−1)^n/(3n+1) from n=0 to ∞
Find the value of ∑(−1)^n/(3n+1) from n=0 to ∞
Review the following resources by clicking on these links: AICPA Code of Professional Conduct - This...
Review the following resources by clicking on these links: AICPA Code of Professional Conduct - This website provides auditors with the principles and rules for conducting professional services Journal of Accountancy - This site provides a current article on Corporate Ethics and Compliance Programs Independence Guide - The Code of Professional Conduct focuses special attention to auditor independence. This provides a guide on independence. A Framework for Auditor Independence - The Journal of Accountancy's article on Auditor Independence Code of...
1. What will be the value of numbers[1] after the following code is executed? int[] numbers...
1. What will be the value of numbers[1] after the following code is executed? int[] numbers = {22, 33, 44}; for(int k = 0; k < 3; k++) { numbers[k] = numbers[k] + 5; } } 2. What will be the results of the following code? final int ARRAY_SIZE = 5; double[] x = new double[ARRAY_SIZE]; for(int i = 1; i <= ARRAY_SIZE; i++) { x[i] = 10.0; } 3.What is the value of numbers [3] after the following line...
Change the format of the given code to two columns, add a sub title and an...
Change the format of the given code to two columns, add a sub title and an author name and increase the color and thickness of the column-rule. Add an image and float the text around the image. <!DOCTYPE html> <!-- Fig. 5.17: multicolumns.html --> <!-- Multicolumn text in CSS3. --> <html> <head> <meta charset = "utf-8"› <title>Multicolumns</title> <style type = "text/css"› p { margin:0.9em Oem; } .multicolumns { /* setting the number of columns to 3 */ -webkit-column-count: 3; -moz-column-count:...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT