VBA (Visual Basic for Applications) is the programming language used to create macros. A good knowledge of VBA can save time and make you a much more productive Excel user. VBA is a common programming language found in virtually all Microsoft Office applications. People will often learn VBA before progressing to other languages in due course.
This VBA quick tip is going to show you how to generate the square and square root of a number. This first little bit of code will generate the square root of the test number which is 8 at the moment but you could have 9826 there it doesn’t matter.
When you run this code it will display a message box with the result in it just like below.
Now the code below is very similar but this why will generate the square of the number. You can get the square of a number by using the ^ (as for formula in a cell).
If you run that code you will get these message boxes appear one after the other.