I was having this same issue for a couple weeks and I literally tried everything I could possibly do. I took the batteries out of the remote and put them back in, put in fresh new batteries, unplugging the cable box and plugging it back in, tried another remote, reset remote to factory default, tried all codes for the cable box and finally went to Comcast and got a new remote. None of it worked, luckily the new remote was free.
It was annoying me so much I began to start playing with my TV settings and decided to change TV's pic mode(Sports, Standard, Movie, PC & Preference) from Movie to Standard and my remote instantly worked. I can't believe it took me two weeks to figure that out. Possibly because I changed it to Movie a few months ago and it took all that time to prevent the remote from working.
So, if your TV has the settings, change the Pic Mode to any other than the current one you are on and the remote should work again.