Create Mark Sheet using Excel VBA
Today we create student mark sheet record system using excel VBA. this top is helpful for beginner in advanced excel. so that please follow the step which is given bellow.Step 1: Create a Macro File with extension .xlsm
Step 2: Create a Mark sheet heading Like this
Step 3: Open VBA Platform
Step 4: Create UserForm
Step 5 : Double Click Command Button(Add Student) or Enter Following Code
Dim rnum As Integer
Range("A1").Select
rnum = Selection.End(xlDown).Row + 1
step 6 : Create a macro and record all formulas of mark sheet
You Get the Like this
Range("A2").Select
ActiveCell.FormulaR1C1 = "Rohit"
Range("B2").Select
ActiveCell.FormulaR1C1 = "35"
Range("C2").Select
ActiveCell.FormulaR1C1 = "48"
Range("D2").Select
ActiveCell.FormulaR1C1 = "75"
Range("E2").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-3]:RC[-1])"
Range("F2").Select
ActiveCell.FormulaR1C1 = "=MIN(RC[-4]:RC[-2])"
Range("G2").Select
ActiveCell.FormulaR1C1 = "=MAX(RC[-5]:RC[-3])"
Range("H2").Select
ActiveCell.FormulaR1C1 = "=AVERAGE(RC[-6]:RC[-4])"
Range("H3").Select
Step 7: cut this Code and paste into the command button after the given code
Step 8: Modify the following code like this
Dim rnum As Integer
Range("A1").Select
rnum = Selection.End(xlDown).Row + 1
Range("A" & rnum).Select
ActiveCell.FormulaR1C1 = TextBox1.Value ' Student Name
Range("B" & rnum).Select
ActiveCell.FormulaR1C1 = TextBox2.Value ' English
Range("C" & rnum).Select
ActiveCell.FormulaR1C1 = TextBox3.Value ' Hindi
Range("D" & rnum).Select
ActiveCell.FormulaR1C1 = TextBox4.Value ' Marathi
Range("E" & rnum).Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-3]:RC[-1])"
Range("F" & rnum).Select
ActiveCell.FormulaR1C1 = "=MIN(RC[-4]:RC[-2])"
Range("G" & rnum).Select
ActiveCell.FormulaR1C1 = "=MAX(RC[-5]:RC[-3])"
Range("H" & rnum).Select
ActiveCell.FormulaR1C1 = "=AVERAGE(RC[-6]:RC[-4])"
Range("H" & rnum).Select
Step 9: Open Module 1 -> Type Code
UserForm1.Show
Inside the Function