Is OP thinking of a 2e optional subclass? "Cavalier," IIRC? I think it was an option in BG1 and Icewind Dale. There was definitely a variant Pally that could not use ranged weapons.