Question

Write a sub using VBA in Excel (in a MODULE) that will print, in a message...

  1. Write a sub using VBA in Excel (in a MODULE) that will print, in a message box, six rows of numbers. Row i will have 3 numbers: i, 2*i and 3*i. Use a for loop for this problem.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code

Sub Test()
Dim str As String
Dim i As Integer
str = ""

For i = 1 To 6
str = str + CStr(i) & " " & CStr(2 * i) & " " & CStr(3 * i) & vbNewLine
Next i

MsgBox (str)
End Sub


output

If you have any query regarding the code please ask me in the comment i am here for help you. Please do not direct thumbs down just ask if you have any query. And if you like my work then please appreciates with up vote. Thank You.

Add a comment
Know the answer?
Add Answer to:
Write a sub using VBA in Excel (in a MODULE) that will print, in a message...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Open up a clean Module and complete the coding of Module in VBA. Do the following tasks 1. Create a “main” sub, and assign the sub to the “Start” button on the worksheet. 2. Write the “clearOutput”...

    Open up a clean Module and complete the coding of Module in VBA. Do the following tasks 1. Create a “main” sub, and assign the sub to the “Start” button on the worksheet. 2. Write the “clearOutput” sub. Also, assign this sub to the “Reset” button. In this sub, you will clear the content of range (B3:D5), (B9:B11), and (D14:D15) on the worksheet “RP”. 3. Write the “loadData” sub. The data is stored in the worksheet “HR”. Name the data...

  • Microsoft Excel VBA (Visual Basic for Applications) Programming Language Objectives: Create an array and redim it...

    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...

  • Excel to VBA Write a program that will add 2 numbers input by the user and...

    Excel to VBA Write a program that will add 2 numbers input by the user and display the result in a spreadsheet. Use an input box and Val () function to convert the user input to a numerical data type.

  • Write a VBA Sub Program to perform matrices multiplication of matrix A and B using 2D...

    Write a VBA Sub Program to perform matrices multiplication of matrix A and B using 2D arrays. a. Get the number of rows and columns of both matrix A and B from the user, and check if multiplication is possible with matrix A and B. b. If matrices multiplication is possible, input the matrix A and B using arrays and multiply matrix A and B.

  • VBA on Excel 2. Complete this problem on Sheet2. a) Write a user-defined function AreaOfTriangle that...

    VBA on Excel 2. Complete this problem on Sheet2. a) Write a user-defined function AreaOfTriangle that computes and returns the area of a triangle with sides s1, s2, s3. b)Test your function AreaOfTriangle by writing a main procedure, which has the user to input the sides , calls the function to find the area , and displays the result with a message box. Test your program with s1=6.5, s2=4.2, s3=5.1.

  • In EXCEL VBA: How would I manage to do this in VBA? The assignment is in...

    In EXCEL VBA: How would I manage to do this in VBA? The assignment is in essence add the amount in one column based upon the what’s in one column. In more description: Column A has a name, column B has random numbers in it, and column C has a price in USD. Some numbers in Column B are the same. For the cells that are the same in column B, I would add together the cells in column C....

  • can someone please help me out with this? i have to write this in vba excel....

    can someone please help me out with this? i have to write this in vba excel. Question 2: (40 Pointsy) The total cnerey, E. ofa movins hint i comual to energy, E, of a moving object is equal to the sum of its kinetic and potential energieS: where m is the mass (in kg) v is the velocity (in m/s) h is the height of the object (in m) g is the acceleration due to gravity (9.81 m/s') 5 m/s...

  • The natural logarithm can be expressed as a Taylor series of the following form 1. Write a VBA pr...

    Please use excel and VBA The natural logarithm can be expressed as a Taylor series of the following form 1. Write a VBA program to calculate the first 50 terms of the series using For or While loop Check the results with a Ln command in Excel The natural logarithm can be expressed as a Taylor series of the following form 1. Write a VBA program to calculate the first 50 terms of the series using For or While loop...

  • Write the code for a). to e) using VBA in excel

    write the code for a). to e) using VBA in excel : . a) Find the fifth customer whose first name starts vith ·K", and show his/her customer ID (using Do while ǐoop) ' b) Redo the above exercise with (Do Loop Until) c) Find how many Matthew are in the 1ist (using any loop you 1ike) and the same time find how many custoners are in the list ' Take care of your stop condition customerCounter - matthewCounter MsgBox...

  • I need this problem to be solved in Excel VBA code. Need full code in VBA....

    I need this problem to be solved in Excel VBA code. Need full code in VBA. Please solve 1st Task : '5 or 0'. Please help me urgently with proper answer and coding solutions which I can run in Excel/vba. Thanks Course: Programming languages Second laboratory work File and string processing Create a program that processes text file according to task variant. Requirements: 1. Create text file (use notepad) with some lines of data according to task variant. 2. Ask...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT