I had to format my computer, but I forgot to create a backup for the games that I had installed. They are all originals and I have the activation code for each one of them. Can I reinstall them or did I make a grave mistake?
Apart from having lost the savegames except for games with cloud functions (e.g. via Steam), you shouldn't have any trouble.
However, some games requiring online activation have a silly counter allowing e.g. only five activations, so if you repeatedly activate a game without deactivating it ever, you may have to call a hotline to convince the publisher that you honestly didn't install it on multiple machines.
And of course if the game installer had to be downloaded, you'll have to download it again, which may require you to contact the respective support for re-activating an expired download-link.
Finally, if your game's publisher meanwhile went broke and you don't have any installation files, then indeed the answer is no, you cannot reinstall that game without entering the already grey zone of asking your friends for their installation files...