VBA basics
26. General practice question 2

Excel macro basics and applications, introduction to Excel VBA
last updated:08-29-2019

26. General practice question 2

Some of this topic was processed by machine translation. Original

Macro VBA exercises

Use the table below for message box and numeric aggregation issues.

VBA macro exercise practice

Input numerical value with InputBox function,
Find the sum of the numbers in column A that are greater than or equal to the specified value, and display it with the MsgBox function.
For example,
If you enter 10 in the InputBox function,
Calculate 14 + 11 + 12 + 13 + 18,
It means that 68 is displayed with MsgBox function.

Tips!
The receipt of the InputBox function is a string. If it is calculated as + 0 or put in a numeric type variable, it can be treated as a numeric value.

Thinking time

Thinking time starts


The sinking time ends

Go to Macro VBA Practice Question Answer



Articles with the same theme "VBA basics"

23. Message box (MsgBox function)

Displays a dialog box (small screen) that displays a message. Users can select (“Yes”, “No”, “OK”, “CANCEL”, etc.) and receive the selection results. To display a message box with macro VBA, use the MsgBox function.
24. Input box (InputBox function)
Displays a message and text box in a dialog box You can get the string entered by the user. In the beginning or middle of macro VBA you may want to change the process according to user input. To achieve this the InputBox function is used in macro VBA.
25. About named arguments
An argument is a specification of a value passed when calling a function or method. There is a named argument as a description method when passing this argument. In the macro VBA description,: = is used.
26. General practice question 2
27. Select book / sheet (Select, Activate)
Excel handles multiple books, Each book has multiple sheets. Therefore, it is necessary to handle multiple books and multiple sheets even in macro VBA. In VBA so far, the active sheet of the active book has been targeted.
28. Select cell / row / column (Select, Activate)
This section describes the description for selecting cells rows and columns in macro VBA. First before explaining cell selection It is necessary to describe the selected cell and the active cell. Selected cell and active cell In this state The selected cells are 10 cells from B2 to C6.
29. Delete / Insert cell / row / column (Delete, Insert)
Macro VBA is explained about deletion / insertion of single cell or multiple cells and deletion / insertion of row / column. Deleting / inserting entire rows / columns by specifying a single cell or multiple cells Deletion / insertion by specifying a row / column will result in the same thing
30. General practice question 3
Macro VBA exercises The problem is shown in the table below. Problems with deleting / inserting rows / columns. ⇒ From the table on the left Delete even-numbered rows insert a blank row in the first row a blank row in column A Use the table on the right.
31. Format Cells (display format, NumberFormatLocal)
By specifying the display format of the cell you can make various appearances even if the value in the cell is the same value. You can keep the cell value as it is and make it look just like the user. Even with the same number 12345 12345 12345 $12
32. Format Cells (Alignment)
Macro VBA can be used to specify the position (vertical position, horizontal position) for displaying the value in the cell. It is the content specified by _Cell Formatting_ → _Placement_. Specifying placement in macro VBA Range.
33. Format Cells (Font)
This is the macro VBA specification method for the typeface of the character displayed in the cell. The font of the cell (Range object) is the Font property. The Font property returns a Font object. I think it's hard to understand.



  • >
  • >
  • 26. General practice question 2

  • If you find this site useful, please share and bookmark.


    I'm going to pay close attention to the description,
    If you have any mistakes or suggestions,「Contact Us」I hope you will let me know.
    Use the posted VBA code at your own risk.
    We are not liable for any damages such as data corruption.




    If you find this site useful, please share and bookmark.
    To the bottom of the text