It has been found that the N-alkylation of aniline, carboxamides and heterocyclic compounds bearing an acidic hydrogen atom attached to nitrogen can be accomplished with alkyl halides in acetonitrile and cesium fluoride-celite employed as a solid base. In this manner, pyrrole, indole, pyrazole, imidazole, benzimidazole, carbazole, phthalimide, indazole, indoline, 2-pyrrolidinone, piperidine and 1,2,4-triazole can be successfully alkylated. The procedure is convenient, efficient and generally gives rise to the N-alkylated product exclusively.