Home > Enterprise >  What is the format of coding the average in ms word vba? I'm new sorry Please be nice
What is the format of coding the average in ms word vba? I'm new sorry Please be nice

Time:06-01

enter image description here

I have a project at my school and I need to calculate the average of all the grades, we're using ms word vba. I know the code is soo dumb but im new and young.

CodePudding user response:

Add the line

Dim average as Double

near the top, and change the assignment lines to use CInt(), e.g.

firstnumber = CInt(txtMath.Text)

and change the average = line to the following

average = (firstNumber   secondNumber   thirdNumber   fourthNumber   fifthNumber   sixthNumber) / 6
  • Related