Sub add_stud()
If Application.CountIf(Worksheets("Data").Columns(3), Range("a_studID").Value) > 0 Then
MsgBox "Existing student ID in database! Quitting...", vbOKOnly, "Duplicate entry!"
Exit Sub
End If
With Worksheets("Data")
next_row = .Range("C" & .Rows.Count).End(xlUp).Offset(1).Row
.Cells(next_row, 3).Value = Range("a_studID").Value
.Cells(next_row, 4).Value = Range("a_lname").Value
.Cells(next_row, 5).Value = Range("a_fname").Value
.Cells(next_row, 6).Value = Range("a_ext").Value
.Cells(next_row, 7).Value = Range("a_mname").Value
End With
ThisWorkbook.Save
MsgBox "Data has been saved!", vbOKOnly + vbInformation, "SF10"
End Sub