抖阴社区

PROGRAM TO CALCULATE MARKS AND AVERAGE

111 1 0
                                    

PROGRAM TO CALCULATE MARKS AND AVERAGE USING EXCEL

PROGRAM TO CALCULATE MARKS AND AVERAGE USING EXCEL

Oops! Ang larawang ito ay hindi sumusunod sa aming mga alituntunin sa nilalaman. Upang magpatuloy sa pag-publish, subukan itong alisin o mag-upload ng bago.

Open Excel.

Activate DEVELOPER. Go to FILE. Click OPTIONS. Select CUSTOMIZE RIBBON. Tick  DEVELOPER. And OK.

Select VISUAL BASIC.

INSERT a UserForm.

Use TOOLBOX CONTROL(note:Dont/Never close Toolbox).

Place FRAME. Total of 2  frames. Edit to STUDENTS TOTAL SUBJECT  and TOTAL AVERAGE.

Place LABELS. Total of 13 labels will be used for (The Title, Maths, English, Biology, History, Physics, Geography, Computer, Agriculture, Cre, Chemistry, Total Marks).

Put TEXT BOX beside each label in the frames.

Put CommandButton. Edit text to CALCULATE. and put the code.

__________________________________________________________________________________________________________________________

Code for command button

Private Sub CommandButton1_Click()

Dim Maths As Double

Dim English As Double

Dim Biology As Double

Dim History As Double

Dim Physics As Double

Dim Geography As Double

Dim Computer As Double

Dim Agriculture As Double

Dim Cre As Double

Dim Chemistry As Double

'applying the coding'

Maths = TextBox1.Text

English = TextBox2.Text

Biology = TextBox3.Text

History = TextBox4.Text

Physics = TextBox5.Text

Geography = TextBox6.Text

Computer = TextBox7.Text

Agriculture = TextBox8.Text

Cre = TextBox9.Text

Chemistry = TextBox10.Text

Total = (Maths + English + Biology + History + Physics + Geography + Computer + Agriculture + Cre + Chemistry)

TextBox11.Text = Total

Average = Total / 10

TextBox12.Text = Average

If (Average < 50) Then

MsgBox ("You FAILED the exam")

Else

MsgBox ("You EXCELLED the exam")

End If

End Sub

_________________________________________________________________________________________________________________________

(note:carefully observe because we might be using different textboxs. In mine, i placed all in order)

You can design your frames and labels now. It's alright if it's plain too. Simplicity is beauty. After designing you  can RUN it. And after that we are done.



Information Technology NotesTahanan ng mga kuwento. Tumuklas ngayon