Career
He served as a deputy representative to the Norwegian Parliament from Buskerud during the terms 1965–1969 and 1969–1973. From March 1971 to October 1972 he served as a regular representative meanwhile Ragnar Christiansen was appointed to the first cabinet Bratteli. From November 1972 Ranheim filled in for Guri Johannessen who had died.
He later served as mayor from 1979 to 1989.
He chaired the county party chapter from 1975 to 1981. Outside politics he was a factory worker