Chosen Solution

I have a Hampton Bay remote control for my ceiling fan. It only operates when i take it very close to the ceiling fan hub. I have replaced a new battery

The infrared receptor may be dusted over. Try blowing it out with some canned air. You might want to vacuum it first if it is really dusty.