What B said. Either that, or the VSS is on it's way out. My sisters 97 Civic EX had this same problem, we later figured out that it was the VSS.
BTW, the VSS is located on the back of the transmission. It faces upwards. It is right along the edge where the bell housing and the engine block meet.