Vicarious nucleophilic substitution using chloromethyl phenyl sulfone was applied to pyridinium and 1, 2, 3-triazinium dicyanomethylides to afford corresponding 4-substituted pyiridinium and 5-substituted triazinium dicyanomethylides, respectively. They were readily transformed to 4-phenylsulfonylmethylpyridines and 5-phenylsulfonylmethyltriazines by radical reaction.