Assuming you meant:
"how to generate a serial number including a given year?", the answer is pretty simple: concatenate the year with a counter, e.g.
20140001
20140002
...
The actual implementation is trivial and left as an exercise.
[update (no one likes exercises anymore)]
Public Function NextCode(ByVal year As Integer, ByRef counter As Integer) As Integer
counter = counter + 1
NextCode = year * 10000 + counter
End Function
Please note, that's really a naive implementation.
You have to write more robust code.
[/update]